Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

psexec giving the system cannot find the file specified

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.

like image 708
lightweight Avatar asked Dec 27 '22 06:12

lightweight


2 Answers

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"
like image 91
David Aleu Avatar answered Jan 14 '23 03:01

David Aleu


Actually, I don't see a difference between your 2 command lines. However, the error from the first command is because your syntax is incorrect. You must use

PsExec \\a.b.c.d ...

instead of

PsExec a.b.c.d ...
like image 43
Ansgar Wiechers Avatar answered Jan 14 '23 02:01

Ansgar Wiechers