Showing posts with label QTP - OPen a process on remote machine. Show all posts
Showing posts with label QTP - OPen a process on remote machine. Show all posts

Wednesday

QTP - Open a process on remote machine

strComputer = "alara01-xp"
'strComputer = "."
'strCommand = "notepad.exe"
'strCommand = "C:\Program Files\HP\QuickTest Professional\bin\QTPro.exe"
'strCommand = "C:\Program Files\HP\QuickTest Professional\bin\QTP.exe"
'c:\Program Files\Mercury Interactive\QuickTest Professional\bin
'strCommand = "c:\Program Files\Mercury Interactive\QuickTest Professional\bin\QTPro.exe"
'strCommand = "C:\Program Files\Internet Explorer\IEXPLORE.exe"
'strCommand = "mspaint.exe"
'strCommand = "IEXPLORE.EXE"
strCommand = "cmd.exe"



Const INTERVAL = "n"
Const MINUTES = 1


Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")


objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)


If errReturn = 0 Then
Wscript.Echo "notepad.exe was started with a process ID: " & intJobID
Else
Wscript.Echo "notepad.exe could not be started due to error: " & errReturn
End If