Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WScript Run
Message
From
18/04/2012 11:28:21
 
 
To
18/04/2012 11:25:12
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01541989
Message ID:
01541990
Views:
52
>Hi All,
>
>I am attempting to use the Wscript Run command to execute an application. I need the parent application to be suspend or running in the background while the child application is running. The problem is that the Run method of WScript is throwing an error that the application can not be found. But it is there.
>
>
>IF FILE("C:\Program Files\Samsung\PlayCamera\PlayCamera.exe")
>     o=CREATEOBJECT("wscript.shell")
>     o.Run("C:\Program Files\Samsung\PlayCamera\PlayCamera.exe",1,.t.)        <== error OLE error code 0x80070002: The system cannot find the file specified.
>ENDIF
>
>
>Why would I get an error if the EXE exists?


THe space in Program Files.

Either go with PROGRA~1 (I think) or maybe try to use

o.Run('"C:\Program Files\Samsung\PlayCamera\PlayCamera.exe"',1,.t.)

Notice the double quotes wrapped in single quotes.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform