Monday, August 26, 2013

Execute Dos Command - QTP

ExecuteDosCommand "cmd /K C:\MyProjects\somefolder\scripts\somescript.bat Testcase1"


Sub ExecuteDosCommand(strCommand)
 ' create the shell object
 Set objShell = CreateObject("wscript.shell")

 ' run the command
 objShell.run strCommand

 ' destroy the object
 Set objShell = Nothing
End Sub 'ExecuteDosCommand

No comments:

Post a Comment