Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an issue trying to execute a batch file using Psexec.
For testing purposes, i have an batch file located at the remote server. The batch file will just do an hello world Echo HelloWorld pause.

When i try to execute the batch file using Psexec, it says that my batchfile was successfully started. But When i go into my server it wasn't. I have run the Batch file physically and it works fine. Wondering what exactly had happened.

I have tried using Psexec to shutdown my server. It works but batch file don't!

Appreciate if experts out there could tell me why! Thanks!

share|improve this question
What psexec command are you using to launch the batch file? – Josh Sep 11 '13 at 4:52
Hi, the command i ran is psexec \\ -u "admin" -p "password" -i -d c:\users\admin\desktop\batchfile\helloworld.bat When i took away the -d i realise that psexec got stuck while running the batch file. It just hangs there. – Friday Sep 11 '13 at 9:20
I have also tried the -accepteula command, and it doesn't work too. – Friday Sep 11 '13 at 9:27
No errors was return. It just stop at calling the batch file and it doesn't exit. while at my remote server, nothing was invoked – Friday Sep 11 '13 at 9:28
Check if the psexecsvc service is still running on the remote host. If so, then stop and delete it using SC command. Also, did you verify your creds were entered correctly and you have admin access? I suggest leaving in the accepteula, but change - to / – Lizz Sep 11 '13 at 13:30
psexec -i 2 -d \\Server -u Domain\Username -p Password c:\Path\to\file.bat

I'm afraid I'm not entirely sure why this works, but having come across this yesterday, this was my solution - the "-i 2", presumably, changing the sort of interaction psexec has with the remote machine. Otherwise, cmd will run as a background process.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.