hina
2 years agoContributor
How to Execute command line utilities within a testcomplete script
I found the script below from TestComplete forums to execute the command line utilities from TestComplete script:
function test()
{
Sys.OleObject("WScript.Shell").Run("C:\\Windows\\system32\\cmd.exe");
var ProcessCmd = Sys.Process("cmd");
var WdwCmd = ProcessCmd.Window("ConsoleWindowClass","*");
WdwCmd.Keys("dir [Enter]");
aqUtils.Delay(5000);
WdwCmd.Close(3000);
}
But when I execute this script I get an error: "The window 'C:\Windows\system32\cmd.exe' is invisible and thus cannot be activated". I am not sure what's wrong with the code. I am trying to execute command line utilities within TestComplete script. Any help would be appreciated.
Thanks,
Hina