>Sergey,
>
>I cannot use unmodified API_APPRUN since I need to pass password using env variable.
>However I tried the same code to run netstat.exe .
>In this case Alt+F key works OK.
>
>I call pg_dump.exe to create backup copies from my VFP 7 or 9 application.
>
>The command which I use to backup database is
>
>C:\Program Files\PostgreSQL\8.0\bin\pg_dump.exe -Z9 -b -v -f "c:\my document\myfile.backup" -F c -h myserver -U postgres mydb
>
>I pass password to pg_dump using environment variable PGPASSWORD
>
>Maybe I need to make some keyboard initialization after pg_dump finishes
>but I have no idea.
>I pass only some Windows environment variables to pg_dump, maybe some critical environment variable is missing.
Why not generate a batch file, like this:
set pgpassword=whatever
C:\Program Files\PostgreSQL\8.0\bin\pg_dump.exe -Z9 -b -v -f "c:\my document\myfile.backup" -F c -h myserver -U postgres mydb
set pgpassword=
exit
and use the .bat's name as the command to run? You can delete the .bat after use (so you wouldn't have a text file containing the password hanging around your disk).
I'm using this technique (generate a batch, run it, delete it) regularly and it seems much easier than trying to do everything in one line.