Run exe on computer in network through batch file

batch-file

I have few computers connected to the network and I want to create batch files to automatize the process of working with them. I have already created one used to shutdown computers at once. It is very simple I ll just post it for the sake of argument.

@echo off
shutdown -s -m \\Slave1-PC
shutdown -s -m \\Slave2-PC
shutdown -s -m \\Slave3-PC

Now I want to execute programs on these machines. So lets say there is "example.exe" file located "\Slave1-PC\d\example.exe"

using

 call \\Slave1-PC\\d\\example.exe

runs it on my computer through network and i didn't come up with anything else. I dont want to use any psexec if possible.
Help would be much appreciated.

Peter

Best Answer

If you really can't use psexec, then you could probably rig something up with schtasks (better) or at (worse).

However, I think you'd probably spend more time trying to get those to do what you want than you'd spend in setting up PsExec. Psexec is really quite simple to use and it only needs to be available (as an executable file; no installer needed) on the machine doing the controlling, not on each machine being controlled.

At its simplest, PsExec is very simple:

psexec -accepteula \\RemoteMachine Command Arguments

Also, Mark Russinovich (PsExec's author) has written a primer that "describes how PsExec works and gives tips on how to use it". Beyond that, "PsExec /?" and the manual do provide quite good information.