I'm writing a backup script in VBScript for a PostgreSQL 9.1 database on a Window 7.
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run postgresqlPath & "pg_dump.exe " & ServerId & " > " & backupFolder & "Database.dump.out"
Wscript.Sleep 500
objShell.SendKeys "Password~"
This script seems to run twice and returns no file in the destination folder.
To exclude errors in the path I had tried the command into the command-line tool, there everything worked fine as expected.
Any hints are appreciated
-f fileto specify output file. And do not forget to put"aroundbackupFolder.PGPASSWORDenvironment variable to pass password to pg_dump.