5

As you can see from the screenshot below, C:\Windows\system32\cmd.exe exists (since the command prompt itself is using that path), and I try referencing it both with the short cmd.exe name and the full path, but both result in the same error from PsExec.exe:

The system cannot find the specified file.

The Network Service user does exist; if I mistype if I get a password prompt and message saying that the username password does not exist.

I receive this error message on multiple computers, but it works on others; with a mix of Windows Server 2008 R2 and 2012 R2. I and am using the latest version of PsExec.exe, which is currently 2.11, and am running the command prompt that I use to launch PsExec as admin, so it should have any necessary permissions.

I've found lots of posts about seeing this problem when running PsExec on a remote machine, but none for the local machine, which I am doing.

Any ideas on what is the problem?

enter image description here

4
  • 2
    try psexec \\localhost -i -u "NT AUTHORITY\NETWORK SERVICE" cmd. Personally, I've seen lots of people have problems with the username/password specs for psexec, so I wonder if they aren't a little buggy. Edit, I got the same error until I specified localhost. Sep 25, 2015 at 23:02
  • I still get the same error when I include \\localhost as you suggested @FrankThomas
    – deadlydog
    Sep 27, 2015 at 14:04
  • odd, that exact command works fine for me. is the command prompt elevated? did you use cmd instead of the full path? Sep 27, 2015 at 17:12
  • Yeah, as I mentioned in my post, the exact same command works on some servers, but not others.
    – deadlydog
    Sep 28, 2015 at 19:08

5 Answers 5

1

The fix ended up being to NOT run the command prompt that I was launching PsExec from as admin. If I run the command from a cmd prompt running as Admin, I get the error. If I run it from a non-elevated command prompt, it works fine.

1
  • 10
    Does anyone know why this would make a difference? Jul 7, 2016 at 13:29
0

Another reason this may happen is you have stopped or disabled LanmanServer (Server) or LanmanWorkstation (Workstation) services.

The way PsExec works, it needs those to function.

1
  • 1
    I had the same issue, and restarting the Server and Workstation services fixed the issue. They were up according to the Services MMC, but PSEXEC wouldn't work until they were restarted.
    – Jason
    Jun 1, 2017 at 17:23
0

I also found that if I copy PSExec to another directory (and the Sysinternals directory is not on PATH) and try to run it from there, it will fail as above. If I run PSExec on the Sysinternals directory then the -s option will work.

So, another item to check is to make sure that either the Sysinternals folder is on the path or that PSExec is executed from that directory.

Apparently, it needs another Sysinternals executable...

0

I had the same problem, the solution was to disable windows defender's Real-Time protection. This was blocking the psexec operation.

0

What fixed it for me was executing the 'psexec' command from the default cmd location (c:\windows\system32 in my case) and give the full path to the argument (the app you're running):

C:\WINDOWS\system32>psexec c:\Projects\newdesktop\someapp.exe

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .