We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More

Forum Discussion

hc_vinod's avatar
hc_vinod
Occasional Contributor
10 years ago
Solved

passing arguments as parameter to command prompt

Hi ,    I need to open a command prompt from my script and need to enter some comands , and these commands i need to pass as a parameter    Something like : i need to open CMD prompt and enter pi...
  • joseph_michaud's avatar
    10 years ago

    Try

     

      var cmd = "ping 127.0.0.1";
      var oShell = Sys.OleObject("WScript.Shell");
      var ret = oShell.run("cmd /C " + cmd, 1, true);
      Log.Message("ret = " + ret);

    See Microsoft docs for more info: https://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.84%29.aspx