Forum Discussion

quessev's avatar
quessev
Occasional Contributor
12 years ago

How to use WScript.Shell in Delphi Scripts

Hello,



I am unable to use WScript.Shell to run a command whose name contains spaces.

It works fine using short notation. What is the syntax to quote correctly?



Sys.OleObject('WScript.Shell').Run('C:\Progra~1\Compan~1\exec.exe option1 option2');

1 Reply

  • quessev's avatar
    quessev
    Occasional Contributor
    Sorry for the noise.



    Sys.OleObject('WScript.Shell').Run('"C:\Program Files\Company \exec.exe" option1 "option2"');



    works fine.