4

I want to execute a bat file in a remote machine and i tried WMI and PSEXEC. I am getting "No process is on the other end of the pipe." error when i try to run the below psexec command.

C:\Users>psexec \\111.111.111.111 -u "sss\user1" -p "ss-12" "\\111.111.111.111\d$\r.bat"

Below is the entire output:

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

Connecting to 111.111.111.111...
Starting PSEXESVC service on 111.111.111.111...
Connecting with PsExec service on 111.111.111.111...

Error reading public key length from PsExec services:
No process is on the other end of the pipe.

However, the below WMI command is working fine. Please help.

wmic /USER:"sss\user1" /PASSWORD:"ss-12" /NODE:111.111.111.111 process call create "D:\r.bat"
King Kamal
  • 195
  • 1
  • 4
  • 15

2 Answers2

4

Try stopping the PSEXESVC service.

pskill \\HOSTNAME PSEXESVC

In your case you would run:

pskill \\111.111.111.111 -u "sss\user1" -p "ss-12" PSEXESVC
0

Got the same issue.

I have found 2 workarounds, which are both not acceptable if you are running your remote machines/servers in production.

First workaround: reboot the machine. It solved the problem 80% of the time.

Second workaround, in powershell run:

    sc.exe stop PSEXESVC
    Remove-Item –path 'C:\Windows\PSEXESVC.exe'
    Remove-Item -Path hklm:\SYSTEM\CurrentControlSet\Services\PSEXESVC -Confirm:$false 

Then reboot.

After I run some more PSEXEC commands, the problem appears again. Will update if I find a solution.

Fab V.
  • 1,052
  • 12
  • 17