Search code examples
windowspostgresqlbatch-filecreateuser

Postgres createuser.exe silent execution from batch script


I am finding myself with the issue of needing to execute the postgres createuser.exe from a batch script and cannot get it to stop prompting me with the following:

Enter name of role to add:

my batch script looks like this:

echo calling createuser! createuser username %super_user% -s -U Super_Postgres s -q

Where %super_user% is a command line argument. Any help would be greatly appreciated, this is the documentation that I am referring too: postgres


Solution

  • "username" should go at the end, after the options. You have it as the first parameter.