Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH Run command with space in file path
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356898
Message ID:
00356902
Views:
14
>I'm getting an OLE error if I use Windows Script Host. This only occurs if the path to the exe to be run has a space in it. Does anybody know of any reason.
>
>The code is basically like this:-
>
>
lcFileName=GetProgToRun()
>loShell=CreateObject("wscript.shell")
>lnResult=loShell.Run(lcFileName, 1, .T.)
>
>This works perfectly well if there is no space in the file name. The exe file is definitely there as this is validated before running.
>
>TIA,

Nigel,

I think it may be that you have to add quotes. (i.e. lcFileName = CHR(34) + lcfilename + CHR(34)). It's a WAG 'cause I haven't tried it.:-)
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform