4

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.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
lightweight
  • 3,227
  • 14
  • 79
  • 142

5 Answers5

5

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"
David Aleu
  • 3,922
  • 3
  • 27
  • 48
3

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 ...
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • ok...so I tried this: psexec \\a.b.c.d -u username -p password c:\autobatch\trigger.bat but still get "Couldn't access a.b.c.d: The network path was not found." it also says "Make sure that default admin$ share is enabled on a.b.c.d." but am not sure how to check that – lightweight Apr 09 '13 at 18:30
  • On the remote host run `net share` in a command prompt. The command lists the shares provided by the host. You also need to be able to access ports `135/tcp` (RPC endpoint mapper) and `445/tcp` (Direct SMB) on the remote host. If you have the Windows Firewall enabled, you must add exceptions for these ports. – Ansgar Wiechers Apr 09 '13 at 21:44
  • I only got the following Share Names back. IPC$ and Hosting. There was no "Resource for IPC$ and the Resource for Hosting was "D:\Hosting." Is IPC$ what I'm looking for? windows firewall is also turned off completely. – lightweight Apr 10 '13 at 13:10
  • If `admin$` is missing on the remote host, some genius seems to have disabled administrative shares. [Re-enable them](http://support.microsoft.com/kb/318755). – Ansgar Wiechers Apr 10 '13 at 14:00
2

I got it to work by elevating the local batch file to execute with administrator privileges, that is to say, the terminal window was operating with administrator privileges.

actor39
  • 21
  • 1
-1

If you're trying to use automation services, you can use the ClientJobSender.exe on the local machine (or on the machine where you set up the scheduling). Just copy the ClientJobSender.exe and the related config file from the install pack to the scheduler server and refer it locally.

anselm
  • 1
-1

You might have the directory path wrong. Try change the .exe path into cmd.exe and cd into your intended path to see if it is actually the correct path.

Lightsout
  • 3,454
  • 2
  • 36
  • 65