>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()
try adding:
IF " " $ lcFileName
lcFileName = '"' + lcFileName + '"'
ENDIF
>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.
>
Yes; it's the command line parser acting as expeted - a space is a delimiter for the CLI, and if you want it not to be treated as such, the full path must be quote encapsulated.