PSTools: PSExec

PSExec is a good tool to start programs on a remote PC. You can start it in different ways and accounts. Like in the System account and that the command window appears at the user’s screen or that it is only showed at your screen what I prefer most of the time. I hope I can give you a little insight in PSExec. As always feel free to ask. I try my best to help you with your problems.

I used PSexec in a previous Article. You can see it here:

You can download the PSTools here:


To start PSExec on a remote machine so that you can run a program without that the user can see a command window just do the following things.

Open a Command window on your own machine (start –> run –> cmd)

drag and drop the psexec.exe file in the cmd window. And type in the PC Name plus -e -s and cmd so that it looks as followed

..psexec.exe \PCName -e -s cmd

now you have a command window which you can see and runs on the remote PC. To start a program in a specific folder you can navigate like in a normal cmd window with cd.. or cd Folder.

Maybe you like to run a program on that machine which is on a Server where only you have access.
You first need to do a net use.

net use \ServerFolderexample.bat Password /user:domainusername

notice: you have to type in your password it will be seen in the cmd window. If you don’t like that you can try to use the following line.

net use \ServerFolderexample.bat * /user:domainusername

when you now press enter it should ask you for your password. For me most of the time it prompts me for a password but does not give me the time to enter it. so i have to type it in and use a cls after it.

anyway now you should be able to make a pushd to the folder where your program is.

pushd \ServerFolder

You are now in the folder and you can run the program with the following command

start "" /wait "example.bat"

here you can look at it at once

..psexec.exe \PCName -e -s cmd
net use \Serverfolderexample.bat * /user:domainusername
pushd \ServerFolder
start "" /wait "example.bat"

please look at the Sysinternal Page for more psexec parameters and for what they are used. i don’t want to copy it but if you have any questions about the parameters feel free to ask