Remote execution of a batch file by UFT
Question ID: 105941
0
0

I want to be able to kick off a batch file on a remote machine by using UFT so that it runs during part of a test. The machine I want to run the batch file on doesn’t have UFT so I’m not sure how to pull this off.

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on February 18, 2015 7:25 pm
108 views
Answers (2)
1
Private answer

You can read its answer here [systemtools][1]

[1]: http://www.systemtools.com/toolboard/showthread.php?2402-remote-execution-of-batch-file

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on February 20, 2015 8:42 am
0
Private answer

Well, it would be easier if you had UFT installed on the remote machine, then you could use UFT's Automation Model to remotely execute the script which would run a SystemUtil.Run ''batchfilename.bat'' or something similar.

I did find an article that talks about using WMI events to kick off remote files like in this example:

This example runs the batch file C:test.bat located on the remote computer TEST-MACH1.

strComputer = ''TEST-MACH1''
Set objWMIService = GetObject(''winmgmts:\'' & strComputer & ''rootcimv2:Win32_Process'')
objWMIService.Create ''C:test.bat'', null, null, intProcessID

You can find a lot of more details if you are interested on this website:

http://blogs.technet.com/b/heyscriptingguy/archive/2006/12/08/how-can-i-start-a-process-and-then-wait-for-the-process-to-end-before-terminating-the-script.aspx

Of course, this is not an officially supported solution, so your success may be limited and you would be on the hook for supporting your code that you use.

Good luck.

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on February 18, 2015 7:31 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top