Ask a Question

How to use WScript.Shell in Delphi Scripts

quessev
Occasional Contributor

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');
Pascal Quesseveur
1 REPLY 1
quessev
Occasional Contributor

Sorry for the noise.



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



works fine.
Pascal Quesseveur
cancel
Showing results for 
Search instead for 
Did you mean: