Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alt key not working after calling API_APIRUN
Message
From
27/10/2005 11:05:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/10/2005 10:56:58
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01060394
Message ID:
01062633
Views:
11
>>
set pgpassword=whatever
>>set cPath=%path%
>>path "C:\Program Files\PostgreSQL\8.0\bin";%path%
>>"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=
>>path %cPath%
>>exit
>
>CreatePRocess() does not allow to run bat files.
>You mean that I must run cmd.exe with passing name of bat file as a parameter to it?

Here's what I do most of the time. Sometimes this gets more complicated - see Capture error output from PkZip25 Thread #1061161 - but basically this is it. Just plain old API_APPRUN, and oprocess.LaunchAppAndWait.
** lcThere is the directory where I want this to run
** lcZipfile is the name of the zip I want to unzip
*-- TEXT BLOCK BEGIN
TEXT textmerge noshow to lcBat
"<<fullpath("pkzip25")>>" -extr  "<<lcZipFile>>"
ENDTEXT
*-- TEXT BLOCK END

lcBatFile=Fullpath(Forcepath(Forceext(Sys(2015),"bat"), lcThere))
Strtofile(lcBat, lcBatFile)
oprocess=Newobject('api_apprun','process', '', lcBatFile, lcThere, 'HID')
oprocess.LaunchAppAndWait
Release oprocess
Erase (lcBatFile)

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