views:

588

answers:

1

I would like to be able to run a batch file on a remote computer after a build, where the build output and batch file are living on the build machine.

In other words, i want the batch file that is running on the remote computer to be located on the build server, available through a UNC path.

I've looked at WMI (System.Management) namespace, but haven't found the correct way of telling it to look at a UNC path for the batch file.

Solutions other than WMI are also appreciated.

Kevin

+2  A: 

Try to use the sysinternal tools psexec

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

It will allow you to remotely execute a file

Heiko Hatzfeld
This works great, but i am having issues capturing the output of the batch file. Any guidance on that?
Mr. Kraus
You can pipe it to a file. you can do so with the > as last parameter, and then fetch that file once you are done
Heiko Hatzfeld
Like "dir >\\Server\share\FileList.txt"
Heiko Hatzfeld
Tried that, but it logs the psexec output, not the process it spawned. So i get the author info (Mark Russinovich) and www.sysinternals.com along with the the process return code.
Mr. Kraus
make sure you include the <whatever in the parameter section of the executable call you make... Make sure you quote it also... you need to pass it to the other server, and not let it process locally
Heiko Hatzfeld