I am working with a group of machines that are on the same network. They are all windows 2008 servers. I want to run a bat file on one machine by using psexec. But when I try, I am getting directory not valid. In fact no matter what directory/path I choose I get an directory not valid error. The firewall is off for both computers. Any suggestions?
Psexec runs all pathing from the winnt\system32 as the working directory unless the -w switch is used. If I am having problems like this I start off doing this from a CMD window:
psexec \\machinename -u userID -p password cmd
This should open the remote command prompt for you. Then trying starting your scripts and figure out what working directory is needed. then you can use the -w switch to like so:
psexec \\machinename -u userID -p password -w WorkingDirectory BatchFileName