Run batch file with psql command without password
I am trying to execute this psql command using a batch script: psql --host=localhost --dbname=<dbname> --port=<Port Number> --username=<dbuser> --file=C:\PSQL_Script.txt --output=C:\PSQL_Output.txt The problem is that it's asking for the password every time I execute the batch script. How can I password argument through the batch file? Keep reading, the best options come last . But let's clarify a couple of things first. Only silence the password request If your issue is only the password prompt, you can silence it. I quote the manual here : -w --no-password Never issue a password prompt. If