psexec giving the system cannot find the file specified

lightweight picture lightweight · Apr 9, 2013 · Viewed 44k times · Source

I'm trying to run this from my win7 CMD (as Admin):

psexec IpAddress -u domain\user -p pword c:\Autobatch\ClientJobSender.exe http://reportserver.net:8070/JobExecutor.asmx c:\AutoBatch\backup\trigger.xml

but am getting a "the system cannot find the file specified" error.

I've also tried it this way:

psexec IpAddress -u domain\user -p pword c:\Autobatch\ClientJobSender.exe http://reportserver.net:8070/JobExecutor.asmx c:\AutoBatch\backup\trigger.xml

but get a unknown user or bad password.

What's weird is that I can connect via Remote desktop with the same IP address and user/pass.

Answer

David Aleu picture David Aleu · Apr 26, 2013

Make sure the server has the settings below:

a) Admin share is enabled: run services.msc and check the Service "Server" is enabled
b) Add the key for the share in the registry and restart:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v AutoShareServer /t REG_DWORD /d 1

And then use:

psexec \\IpAddress -u domain\user -p pword -w "c:\Autobatch" "ClientJobSender.exe http://reportserver.net:8070/JobExecutor.asmx c:\AutoBatch\backup\trigger.xml"