How do I launch a script on a remote machine?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pppbigppp
Posts: 1
Joined: 09 Oct 2010 23:22

How do I launch a script on a remote machine?

#1 Post by pppbigppp » 09 Oct 2010 23:36

My setup at work requires me to setup a bunch of test equipments on multiple machines to run tests. Let say I automate all the process into batch scripts on each machine, is there a way to use batch in conjunction with another program so that I can just launch one script on one machine and it would execute the other scripts on other machine? Bonus: something that supports file transferring over the network, and something that

I have control over the network so security isn't a concern at all. Platform are WinXP, Win2K3, Win2K8, or Win7. I can install any server app and any service on anyone of the machines. Free software only please.

I'm looking into the commandline of WinSCP, openSSH, etc. right now, but I want to see if there is an easy way that has already proven to work well.

jmituzas
Posts: 13
Joined: 30 Aug 2010 08:43

Re: How do I launch a script on a remote machine?

#2 Post by jmituzas » 11 Oct 2010 07:57

I have found this link which may help you out:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/49357953-61a7-4bc3-9cfd-ddee4a321fa8

Your best approach is to do the following using WMI:

1. Invoke Win32_Process
2. In the remote process, use a cmd call and dump to a text file on the remote machine.
3. open a mapped drive to the remote machine.
4. Read the remote file.
5. delete file.
6.Close connections.

The following script gets the netstat information from a remote server. This will dump the remote netstat into a DataGridView. This assumes you are using:

1. .NET 2.0
2. A DataGridView called DataGrid1 (use a Datagrid object in .NET 1.1 with some variations).

link above has sample script.

Post Reply