WshShell "The system cannot find the file specified"
Use of the WshShell in our test suite has suddenly stopped working and I cannot figure out why.
I have written a simple test to hone in on the error:
function test() { //Don't check this in
WshShell.Exec("dir")
}
Running this function pops up the error
Shell is the name of the script I have written this function in. It definitely does exist at the path specified (though I find it strange there's no file extension in the error).
TestComplete is running as admin. This error seems to be happening no matter what the command is.
To be totally honest, I don't fully understand how WshShell works. If there is something in the properties of the project that need to be setup in order for it to work there's a good chance that's been accidentally broken, but I can't find anything anywhere telling me what that setup is, so I can't check.
Any help would be appreciated.
I thought you are passing some command from dir as para
Microsoft have provided article to run dir as WshShell commandTry with this and check whether you need this one
function test()
{
WshShell.Run("%comspec% /k dir",1,true)
}
https://devblogs.microsoft.com/scripting/how-can-i-call-the-dir-command/