how to use psexec to call a .bat file remote

March 2, 2011 at 16:20:11
Specs: Windows XP
Hello, I need to call a .bat file on Server A from Server B.

So on Server B, we installed psexec on D:\orc\psexec

From a cmd line: I executed the following command:

D:\orc\psexec\psexec \\ServerA -u admin -p password -d -i "D:\orc\bin\test.bat"

It gives me a message back that says starting D:\Orc\bin\test.bat and a proces id 1234.

however, nothing is happening at all. How could I tell that the process actuall ran? Thanks so much for the help!!


See More: how to use psexec to call a .bat file remote

Report •


#1
March 2, 2011 at 20:03:50
Don't use the -d switch and/or the -i switch.

How To Ask Questions The Smart Way


Report •

#2
March 3, 2011 at 09:33:08
Hello Razor 2.3, I tried executing that same syntax without the -d or the -i and it gave me a "cannot find paht specified" Without the -i how do I tell psexec to run the .bat file?

Thanks so very much for taking the time and help!


Report •

#3
March 3, 2011 at 10:12:42
Obvious question: Is the file at "D:\orc\bin\test.bat" on server B?

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
March 3, 2011 at 10:24:13
Hi Razor 2.3, thanks so much for the help!! Your suggestion worked - I had a typo on the Server name.

however, myy bat file on Server A requires some java components to run, it seems that even if it could execute the .bat file remotely, it is all dependent on what you are trying to execute with your file. Even though in my .bat file, I declared the path as to where to execute the command, when psexec tries to run it remotely, it brings the command to the C:\Windows\system32\ path which of course does not contain the script to run the command inside the .bat file.

Thanks so much for the help. I truly appreciate it!


Report •

Ask Question