How do I execute a command that may be in one of two paths?

Viewed 15

I have those two paths :

C:/"Program Files"/PostgreSQL/14/bin

C:/"Program Files"/PostgreSQL/14/lib

and I have this command :

pg_dump -h localhost -U postgres -p 5432 -Fc -d notImportant > C:/Users/LENOVO/Documents/GitHub/app-reports-be/src/utils/sample.backup

pg_dump is locatet either in lib or bin. I am making an enviroment variable in my app in my .env file (I don't wanna have system enviroment variable). How can I tell my enviroment variable PATH to search first in bin and then in lib.

Like this :

C:/"Program Files"/PostgreSQL/14/lib & C:/"Program Files"/PostgreSQL/14/bin pg_dump -h localhost -U postgres -p 5432 -Fc -d notImportant > C:/Users/LENOVO/Documents/GitHub/app-reports-be/src/utils/sample.backup

0 Answers
Related