0

I am running the below code in the testcomplete . It opens a command line and executes the command mentioned in the command line. However after the execution of the command , the control is not returned back to the testcomplete. what seems to be the issue here?

WshShell.Run("cmd /K cd C:\Users\Tester\ & echo testing",1,true); Log.Message("completed");

1 Answer 1

0

The 'issue' seems to be the '/K' in your command line: This means, cmd keeps open after running the commands. (I.e. WshShell is waiting for cmd to complete for ever.) Try '/C' instead: this means, cmd run the commands and ends after that. I.e:

WshShell.Run("cmd /C cd C:\Users\Tester\ & echo testing",1,true); Log.Message("completed");

You get more input on the /C and /K options calling following command from the prompt:

cmd /?

(Do WindowsKey+R, type cmd.exe and then enter to get the prompt.)

I hope this help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.