Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alt key not working after calling API_APIRUN
Message
From
25/10/2005 20:35:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/10/2005 14:47:49
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01060394
Message ID:
01062105
Views:
19
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform