tim_faron
12 years agoContributor
Trouble getting dos command to execute as expected
I am trying to get the following command to run.
var Command = 'cmd /c wmic datafile where name="C:\\Program Files (x86)\\abc\\123\\abc efg\\aaa\\vv d e\\something.dll" get Version';
var oExecute = Sys.OleObject("WScript.Shell").Exec(Command);
When i paste it into the command window it's executing as i expect giving me 2 strings returned.. but via TestComplete 'Exec' it's running but the oExecute.ReturnCode is not zero and there are no results.
I have tried all different quote combinations but can seem to get it right.
Thanks
var Command = 'cmd /c wmic datafile where name="C:\\Program Files (x86)\\abc\\123\\abc efg\\aaa\\vv d e\\something.dll" get Version';
var oExecute = Sys.OleObject("WScript.Shell").Exec(Command);
When i paste it into the command window it's executing as i expect giving me 2 strings returned.. but via TestComplete 'Exec' it's running but the oExecute.ReturnCode is not zero and there are no results.
I have tried all different quote combinations but can seem to get it right.
Thanks