Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


Return to article

PsExec
 

PsExec is a command-line tool that lets you execute processes on remote systems and redirect console applications' output to the local system so that these applications appear to be running locally. You can download PsExec for free from the Sysinternals Web site. Here are some advanced tips and tricks to help you leverage the full potential of PsExec as a systems management utility.

The PsTools Suite
PsExec is a member of Sysinternals' PsTools suite, which contains 11 tools. To be in the suite, tools must conform to a set of specifications that includes supporting Windows NT 4.0 and later, being a console application, and having the ability to work on the local system as well as on a remote one. PsTools utilities require no manual installation of software on the remote system, and they let you specify alternative credentials to access the remote system.

Incidentally, the reason that the suite is named PsTools and that all the member tools have Ps as a prefix to their name is that the first tool I developed that satisfied the listed criteria was PsList, a program that lists running processes. I named the tool after the ps utility that performs the same function on UNIX systems.

As with many of the tools in the PsTools suite, PsExec's ability to run processes remotely requires that both the local and remote computers have file and print sharing (i.e., the Workstation and Server services) enabled and that the default Admin$ share (a hidden share that maps to the \windows directory) is defined on the remote system. The reasons for these requirements will become clear later when I describe how PsExec works.

PsExec
PsExec's ability to run processes remotely with no manual installation of software on the remote system makes deployment easy. However, if PsExec were only able to launch a program on a remote system, its usefulness would be limited. PsExec's ability to redirect the input and output of console applications is what makes the tool a versatile systems management utility. Figure 1 shows PsExec's command-line options and gives a hint as to its capabilities. Many Windows administrative console tools can run only on a local machine. PsExec lets you remote-enable any of them. For example, PsExec lets Ipconfig, the Windows utility that displays the TCP/IP configuration for a system's network adapters, show a remote system's configuration. A sample command for that use is

psexec \\remote ipconfig

where remote is the name or IP address of the system you want to query. You'll see Ipconfig's output as if you had run Ipconfig on the local machine.

If you don't specify the path of the program you want to execute, PsExec looks in the \windows\system32 directory of the remote system. If you know that the program isn't in that directory, enter its full path on the remote system; if it's an executable on the local system that you want to execute on the remote system, specify the -c switch and the file's local path. The -c switch directs PsExec to copy the specified executable to the remote system for execution and delete the executable from the remote system when the program has finished running.

An even more powerful use of PsExec's console-redirection capability is to run a command prompt on a remote system as if the command prompt were running locally. This use of PsExec is similar to running a Telnet client on the local machine and connecting to a Telnet service on the remote machine, but you don't need to have the Telnet service, or any other special service, running on the remote system. Simply execute the command:

psexec \\remote cmd

If you want to execute one console command on the remote system, pass the command prompt the /c switch followed by the command you want to execute. For example, the command

psexec \\remote cmd /c ver

displays the Windows version number of the remote system on the local machine's console.

Another popular use of PsExec is to deploy hotfixes or other patches that support a noninteractive interface across your network. To make this task even easier, PsExec takes multiple computer names, the name of a text file containing a list of computer names, or the special name of \\* that results in an enumeration of all the computers in the current domain. For instance, to execute the Microsoft MyDoom removal tool on computers named Remote and Remote1 and log the exit status of the cleanup to a file, you could use the command

psexec \\remote,remote1
	-c doomcln.exe
	-s 2> results.log

Upon exit, a process specifies an integer that the process's parent process can read. Programs often use the exit code to report the success or failure of their execution. Whenever a process executed with PsExec is completed, PsExec displays the process's exit code and returns the exit code as its own exit code. You should test a program's behavior or check its documentation to determine what that program's specific error codes mean, but an exit code of 0 typically means success. The -s switch specifies that PsExec should execute the command under the System account. I'll discuss this option more in a moment.



PsExec Security
You should be aware of several ways in which PsExec interfaces with Windows security. By default, the process you execute on the remote system impersonates the account from which you run PsExec on the local system. Impersonation is somewhat restricted from the perspective of security—the remote process doesn't have access to any network resources, even those that your account typically would be able to access. If the account in which you're running doesn't have local administrative privileges on the remote system, the process you want to run requires access to network resources, or you want to run a process in a different account, then use PsExec's -u switch to provide an alternative account name. For example, you could enter the command

psexec \\remote
-u remote\administrator
-p adminpass ipconfig

to run Ipconfig under the Administrator account on the remote machine. Use the -p switch to enter the password for the account you specified with the -u switch. If you omit the -p switch, PsExec prompts you to enter the password (for security reasons, PsExec doesn't echo the password you enter to the screen).

If you specify alternative credentials, the remote process runs with those credentials and will have access to network resources that the alternative account can access. To run in a different account, PsExec must use that account to log on to the remote system. PsExec therefore requires the password on the remote system and sends the password in clear text from the local system. You need to be aware of this fact if unauthorized network sniffers could intercept traffic between the local and remote system.

You can also run the remote process in the System account, under which Windows services and core Windows processes, such as Winlogon and the Local Security Authority Subsystem Service (LSASS) are executed. The System account has powerful privileges. Some file-system and registry resources have default security settings that permit access only from the System account—examples are the HKEY_LOCAL_MACHINE\SAM registry subkey and the \System Volume Information directory that's present on each volume of all Windows 2000 or later systems.

For example, if you've ever been curious about the contents of the SAM subkey, which appears empty in regedit because regedit can navigate the subkey only under the System account, you can use PsExec similarly to the way you use the Runas command (which is available on Win2K and later) to run regedit under the System account. The command is this:

psexec -s -i
c:\windows\regedit.exe

Note that the command doesn't include a remote computer name and does include the -i (interactive) switch. When you enter the command, regedit will appear on your desktop running in the System account, and you'll be able to look inside the HKEY_LOCAL_MACHINE\SAM and HKEY_LOCAL_MACHINE\SYSTEM subkeys. The -i switch is what causes regedit to appear on the console desktop, and it's typically useful only when you want to run a GUI application on the local system where you can interact with it.

A last security note relates to viruses. Several viruses use PsExec to propagate within a network, and as a result, several major antivirus products flag PsExec as a Trojan horse program or a worm. Remember that PsExec works on remote systems only if it runs within an account that has administrator group membership on the remote system. In other words, unless the account from which you run it has administrative access to a remote system, PsExec won't be able to execute a process on the remote system. In addition, PsExec's functionality can be achieved in other ways; thus, PsExec is only a convenience for virus writers, who could otherwise easily implement the functionality that PsExec provides.

Inside PsExec
PsExec starts an executable on a remote system and controls the input and output streams of the executable's process so that you can interact with the executable from the local system. PsExec does so by extracting from its executable image an embedded Windows service named Psexesvc and copying it to the Admin$ share of the remote system. PsExec then uses the Windows Service Control Manager API, which has a remote interface, to start the Psexesvc service on the remote system.

The Psexesvc service creates a named pipe, psexecsvc, to which PsExec connects and sends commands that tell the service on the remote system which executable to launch and which options you've specified. If you specify the -d (don't wait) switch, the service exits after starting the executable; otherwise, the service waits for the executable to terminate, then sends the exit code back to PsExec for it to print on the local console.







Reader Comments

I'd forgotten about PSExec until Mark's article reminded me. I encountered an odd problem in that any command executed, e.g. ipconfig, on a remote machine returns, "PsExec could not start cmd on remotecomputername The directory name is invalid." Seems kind of odd in that every other remote tool we use works just fine. I've been unable to find any additional information about this error. Any ideas?

JC Warren -July 08, 2004

We have been using PSEXEC for several years. It allows us to have a central scheduler PC run overnight batch jobs on several different machines. It given us the bases for applying security patches to our PC, atleast until we finish implementing Altiris. Want to say a HUGE thank you to Mark for all his little utils that have save my butt on more than one occasion. CHEERS

VoyageurX -July 15, 2004

When I tried to use the PSEXEC command like "psexec -s -i c:\winnt\regedit.exe" to run REGEDIT under the System account,what returned jsut like "psexec /?".I was confused,any ideas?

JunLiu -August 19, 2004

Amazing tool!

Anonymous User -February 02, 2005

For those having problems getting the PSTools to run on the remote server due to security warnings/access denied/etc., here are a couple of tips, at least for Windows XP servers: - on the server turn off "simple file sharing" - create a user on the server with the same login name and password as the person who will be running psexec. - add that user to the Administrators group on the server Very important (!): - Now that you have changed the security on the server, open Computer Management and force all sessions from this user to close (logging off doesn't always do it). Now the server will see the user connect again and use the new security settings. - Steve Yates - Too err is human. To moo, bovine. ~ Taglines by Taglinator - www.srtware.com ~

Anonymous User -February 10, 2005

I kept getting ACCESS DENIED errors, after much googling, found that the local user account you are running psexec from cannot have a blank password. Windows wont let you run anything remotely if the account the request comes from has a blank password.

Anonymous User -February 22, 2005

I loved this little utility that does all. what does mean when I get the following error: Defrag.exe exited on computername with error code 0? almassud@hotmail.com thanks

Anonymous User -February 24, 2005

Usually error code zero means no error occurred. Anything above zero is an error.

Anonymous User -February 25, 2005

Does anyone know how to get around this problem: When using psexec to run a batch file or a cmd session, if you use SET /P to set an environment variable it only uses the first letter instead of the whole line. Example code: psexec \\remote cmd.exe set /p username=Enter DB Username: Enter DB Username: Glen 'len' is not recognized as an internal or external command, operable program or batch file. set username username=G Any help or suggestions are appreciated.

Anonymous User -February 28, 2005

Some of the CRLF's got left out of my last post there is supposed to be newline between "cmd.exe" and "set" and between "set username" and "username=G"

Anonymous User -February 28, 2005

You have to set quotes befor "cmd.exe until the end of the script

Anonymous User -March 02, 2005

Sorry I wasn't more clear, I actually transfer a batch file over to the remote computer and run that, that file prompts for the password, which is supposed to be enterred by the person on the local computer. Basically it is a waste to hard-code the password because they change monthly (also bad security) and the password is required on the remote machine, not the local machine. I can get the script to run just fine, except for "Set /p" lines which never work, and only keep the first letter entered by the local user, then sends the rest of the letters to the next command. I think this must be a bug between the way psexec works and the way SET /P works because any other command can accept a string, but each call to SET /P only gets the first letter. In the batch file, if I have: SET /P USERNAME=Enter Username: SET /P PASSWORD=Enter Password: SET USERNAME SET PASSWORD If I enter Glen as the Username, the output will look like this: Enter Username: Glen Enter Password: l USERNAME=G PASSWORD=l 'en' is not recognized as an internal or external command, operable program or batch file. I hope that was a bit more clear, I added extra CRLF's in case they get stripped from this post again. I did try using quotes in different ways, basically it puts the first quote into the variable and passes the rest of the characters to the next command. If I'm running a cmd.exe remotely and I type SET USERNAME=Glen it does work, it's just the /P prompt feature which is relatively new to the SET command and maybe was not tested in psexec development.

Anonymous User -March 02, 2005

test

Anonymous User -March 02, 2005

I use psexec to run a batch file on the local machine as another user (which works without problems). However, after the batch has finished, psexec hangs for quite a long time until reporting that the process has finished. Is there anything one can do about that delay? Thanks in advance!

Anonymous User -March 04, 2005

I want to use a batch file to automatically open CISCO VPN client and enter user name and password

Anonymous User -March 08, 2005

The credentials supplied conflict with an existing set of credentials.can anyone please solve this problem

Anonymous User -March 10, 2005

Is it possible to psexec in a specific session on the remote computer?

Anonymous User -March 11, 2005

JC Warren I have the same problem here.. http://groups.google.de/groups?hl=de&lr=&selm=bitpi3%2416sf%241%40arachne.labyrinth.net.au looks like a solution here. :-)

Anonymous User -March 11, 2005

RE: The credentials supplied conflict with an existing set of credentials.can anyone please solve this problem This usually happens when you already have a share to the computer with a different user account. For instance if your account has a share to this computer and your psexec line uses a different account. Use NET USE to list all your existing shares and DELETE the one you are trying to connect with.

Anonymous User -March 15, 2005

psexec has gone crazy on my system. It repeats the command in an infinite do-loop until I control-c to stop the batch file. However, if I type in another psexec command, it goes right back to the "stuck" one & loops again. This behavior survives reboots. My system is still executing a psexec command that I typed in a week ago & will not recognize any new psexec command input. How do I stop it?

Anonymous User -March 15, 2005

a

Anonymous User -March 19, 2005

Anybody encountered these erros in the system event log on Windows Server 2003: The PSEXESVC service entered the stopped state. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Also these in the application event log: Reporting queued error: faulting application PSEXESVC.EXE, version 1.23.0.0, faulting module unknown, version 0.0.0.0, fault address 0x00000000. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Anonymous User -March 21, 2005

it's one of the best tools I've ever used. I can even read/write Windows EFS encrypted files on a remote machine from the local screen!

Anonymous User -March 21, 2005

I'm getting "The system cannot find the file specified" when I attempt to run a vbscript. Ipconfig and other commands do run properly on the same computer.

Anonymous User -April 01, 2005

since NAI detected PSEXESVC as a virus and tried to remove it, psexec falis to start on those servers. The windows event log reported Event ID 7000, the system can not find the file specified.

Anonymous User -April 07, 2005

To stop that file from running until you determine the source (Scheduler? or ??) get the following program - killbox - and end the process / file. http://www.bleepingcomputer.com/files/killbox.php

Anonymous User -April 07, 2005

Hello, can anyone help me with this error, it appears from time to time on scheduled batch scripts but when i execute the script in command prompt manually it's allways ok. psexec \\rforsap33 c:\stop_ob_portal_prd.bat PsExec v1.56 - Execute processes remotely Copyright (C) 2001-2004 Mark Russinovich Sysinternals - www.sysinternals.com The process tried to write to a nonexistent pipe. Connecting to rforsap33... Starting PsExec service on rforsap33... Connecting with PsExec service on rforsap33... Starting c:\stop_ob_portal_prd.bat on rforsap33... c:\stop_ob_portal_prd.bat exited on rforsap33 with error code 1. Tnks, jmcpinto (at) gmail (dot) com

Anonymous User -April 11, 2005

Your context looks incorrect. Can you reply with the full context you use to invoke stop_ob_portal_prd.bat?

thomas.mshar -April 11, 2005

Whenever I try to run psexec -v (or anything else) I get an "Access is denied" message. I'm anxious to get this working so any tips would be most welcomed

Anonymous User -April 11, 2005

very useful tool.But can any one guide me about file share and print share and how to enable/disable them

Anonymous User -April 15, 2005

Dear thomas.mshar, We have a script on machine rforsap30 with 3 commands: psexec \\rforsap33 c:\stop_ob_portal_prd.bat psexec \\rforsap34 c:\stop_ob_portal_prd.bat cluster /cluster:PORTALCLT resource "SQLServer" /off the psexec call for rforsap33 and rforsap34 works well sometimes and fails with the error "The process tried to write to a nonexistent pipe" othertimes. I cannot find a reason for this random execution. The user is a domain user with administration authorization (same user for all machines). Thanks for your help, jmcpinto (at) gmail (dot) com

Anonymous User -April 18, 2005

I am totally new to this tool, but using it to run MS patches. I choose to run this on the remote system(s) using yhe -i, and everthing starts. How do I get the patch to finish and answer the prompts ("next" Finish" etc..) If I run w/o the user intervention (-i)on the client, the psexec tool appears to hang. I assume this is because it is waitng for input. Any help would be helpful

Anonymous User -April 18, 2005

I keep getting "Access is denied" message. Could somebody please assist me? I've gone through the other comments but I dont understand them. Please help. S.M. Adam

Anonymous User -April 19, 2005

Hello, I am using psexec from a remote computer (c code). fprintf(pt,"psexec \\\\recon1 -u administrator -p sparky -i d:\\\\reconparallel.exe\n"); fprintf(pt,"psexec \\\\recon2 -u administrator -p sparky -i c:\\\\reconparallel.exe\n"); I write this command in a file and run that file. Its working fine. The only thg is that it runs the command on recon1 1st, completes the command, and then run the command on recon2. Since the 1st command take like 6hrs to complete, I wanted to know if there is a way when it runs both the command at the same time on 2 different comouters (recon1 and recon2)? Thnaks

bhatianikita -April 19, 2005

psexec \\mach1 -i -d -s -f -c -w C:\scripts "C:scripts\CheckoutandBuildMyApps.bat" This command works if the file does not exist on the remote machine. If the file exists, it is supposed to force copy the file (-f option) to the remote machine. It executes the older version of the script and does not state that it has failed to copy the file. Any Clues? Thanks in advance.

Anonymous User -April 22, 2005

Hi Guys I need some help, Does anyone know what is used to separate the computer names in the text file when psexec is used with the @file parameter? I used psexec @test.txt -c “c:\test.exe” Contents of test.txt xxxpc001, xxxpc02, comma and space as separators.

Anonymous User -April 29, 2005

Hi Guys I need some help, Does anyone know what is used to separate the computer names in the text file when psexec is used with the @file parameter? I used psexec @test.txt -c “c:\test.exe” Contents of test.txt xxxpc001, xxxpc02, comma and space as separators doesn't work!!

Anonymous User -April 29, 2005

PsExec rocks. What would make it rock even more is if one could specify a foreground/background color for the interactive command prompt. That way there would be a CLEAR indication that one was working on a remote system. Then when the PsExec ends, the prompt could go back to the original colors...

Anonymous User -May 04, 2005

I am totally new to this tool, but using it to run MS patches. I choose to run this on the remote system(s) using yhe -i, and everthing starts. How do I get the patch to finish and answer the prompts ("next" Finish" etc..) If I run w/o the user intervention (-i)on the client, the psexec tool appears to hang. I assume this is because it is waitng for input. Any help would be helpful Try looking into MS patch command line options from http://unattended.msfn.org Hello, I am using psexec from a remote computer (c code). fprintf(pt,"psexec \\\\recon1 -u administrator -p sparky -i d:\\\\reconparallel.exe\n"); fprintf(pt,"psexec \\\\recon2 -u administrator -p sparky -i c:\\\\reconparallel.exe\n"); I write this command in a file and run that file. Its working fine. The only thg is that it runs the command on recon1 1st, completes the command, and then run the command on recon2. Since the 1st command take like 6hrs to complete, I wanted to know if there is a way when it runs both the command at the same time on 2 different comouters (recon1 and recon2)? Thnaks Add the word "Start" before each line, that will start a new command process for each line and continue on with the file. For @file, if I remember correctly you just list the computers, try seperating them on each line, it is probably just white space.

Anonymous User -May 06, 2005

hi, i have the same problem than jcmpinto, the psexec command says : The process tried to write to a nonexistent pipe .... :( i call the psexec command in a java program : cmd /c C:\psexec \\10.66.X.X -u myuser -p mypasswd -i -w F:\Naming\ F:\Naming\NewTest.bat and the biginnig of the .bat is : set PATH=.;bin;..\shared\orbacus_v4.0.4_patched5;..\Imr\bin;..\utils;%PATH% set CONFIG=..\config\orbacus.config FOR /f "delims=" %%a in ('CD') DO SET CWD=%%a nameserv.exe --version 2>db\version.txt for /f "delims==" %%i in (db\version.txt) DO set l=%%i title Installation of %l% ...

Anonymous User -May 09, 2005

Hi. Two questions. 1) In our script we map to a network drive and this line of code fails: net use x:\\networkdrive\dir x: copy .... Should this work? 2) What means "The process tried to write to a nonexistetnt pipe." message? Thanks a lot!!!

Anonymous User -May 09, 2005

Hi weather Pstools will work only on NT Version i am using Xp is it possiable to use pstools plz send u r reply to asprabahar@gmail.com

Anonymous User -May 11, 2005

We use PsExec as a 3rd tool with our product to remote deploy software's over the network. The command we pass to PsExec psexec \\10.10.51.26 -u 10.10.51.26\test -p test -c -f -i -e test.exe We prepend the user name with the machine when the domain name in not provided. If the domain is provided we just use the domain administrator’s user name for remote deployment. One of our customer does not wants give domain admin user and pwd. So as a test fix we remove the machine name from the user name psexec \\10.10.51.26 -u test -p test -c -f -i -e test.exe Now the remote deployement fails. Just wanted to know which is the correct option to pass to psexec if the machine is in a domain. psexec \\10.10.51.26 -u 10.10.51.26\test -p test -c -f -i -e test.exe or psexec \\10.10.51.26 -u test -p test -c -f -i -e test.exe or psexec \\\\10.10.51.26 -u test -p test -c -f -i -e test.exe

Anonymous User -May 12, 2005

I have been using psexec with Windows 2000, but when I use it with Windows 2003 server, jobs that use mapped drives fail. See the examples below. Example 1 is a mapped network drive and Example 2 is a local drive. Is there any way I can make this work with Windows 2003? Thanks! ********* EXAMPLE 1 ************************ C:\Xformer>psexec \\transform4 -s -u administrator -p xxxxxxxxxx cmd /C dir s: PsExec v1.58 - Execute processes remotely Copyright (C) 2001-2005 Mark Russinovich Sysinternals - www.sysinternals.com The system cannot find the path specified. cmd exited on transform4 with error code 1. ********* EXAMPLE 2 ************************ C:\Xformer>psexec \\transform4 -i -u administrator -p xxxxxxxxxx cmd /C dir d: PsExec v1.58 - Execute processes remotely Copyright (C) 2001-2005 Mark Russinovich Sysinternals - www.sysinternals.com Volume in drive D has no label. Volume Serial Number is 8456-8877 Directory of d: 05/15/2005 04:28 PM

temp 05/13/2005 03:05 PM WUTemp 0 File(s) 0 bytes 2 Dir(s) 23,378,264,064 bytes free cmd exited on transform4 with error code 0.

jharrington -May 16, 2005

alright.. a quick question im copying a .bat file through my network. the .bat file have this inside of it: NET USE P: \\apathtomynetwork Now, after the copy i m doing this : psexec /u myuser/p mypass \\%%Q \\%%Q\c$\startnet.bat %%Q beying my variable thats looking through a txt file thats = to the computer name in the list.. now on my local computer ( the one that im running all this script on ) im having the following: the command completed successfully \\%%Q(his name) \c$\startnet.bat exited on %%Q(his name) with error code 0. AND even thought it says completed , it still dont map the drive on the remote computer basicly. I know their is Active directory solutions but i do not want to use it for other reason.. is their a way to do that ? anybody know how to make that work ? if i execute the startnet.bat from a remote desktop on the %%Q computer , it works perfectly.. Please help!! thanks alot

Anonymous User -May 20, 2005

When psexec'ing to more than one system at a time, psexec echoes each system name before the info. This looks OK on a DOS cmd window, but if the output is redirected to a file, ALL systems names are appended to the end of the file, after a system info is included. Not good!

Anonymous User -May 23, 2005

i'm not able to use the "net use" cmd with psexec, even as member of local Administrators group of the machine.

Anonymous User -June 02, 2005

I used for a while and got an interesting issue. I have no problem to use it with most of my server. But from some of them, for exampl I executed psexec \\myserver ipconfig, and then psexec shows connecting with myserver and then "Starting PsExec service on myserver..." The commmand is just hung there. Any suggestions? thx a lot.

Anonymous User -June 08, 2005

I have the same question on how to run PsExec on @file. What is the right syntax? Thanks Much "Hi Guys I need some help, Does anyone know what is used to separate the computer names in the text file when psexec is used with the @file parameter? I used psexec @test.txt -c “c:\test.exe” Contents of test.txt xxxpc001, xxxpc02, comma and space as separators doesn't work!! Anonymous User - April 29, 2005 (Article Rating: ) "

Anonymous User -June 28, 2005

Those of you who may still be having "Access Denied" problems using psexec on XP, here's something else to look at: Apparently, updates to XP (most likely Security Updates delivered via Windows Update) now set a local security policy setting differently than in the past. Do Administrative Tools->Local Security Settings->Local Policies->Security Options and look for the line "Network Access:Sharing and security model for local accounts". As of at most 6 months ago, the default value for this "key" was "Classic - local users authenticate as themselves". But new XP installations and those with recent security updates will have a default value of "Guest only - local users authenticate as Guest". Change it back to "Classic - local users... etc.,." Now give psexec a shot.

Anonymous User -July 04, 2005

Scanstate errors out on a remote machine when run with psexec using the '-d' switch. Without the '-d' it works fine, but I plan to backup multiple machines remotely and want to be able to do this asynchronously and not have to wait for each scanstate session to finish as is the case here. I'm running this on XP SP1/2 and get a memory reference error (which I could provide later). Scanstate takes about 20 minutes to run, but the error seems to happen within a minute or so, so it doesn't appear to be a timeout issue (I can run xcopy with psexec -d for about 20 minutes without a problem). Any ideas most welcome. Thanks

Anonymous User -July 16, 2005

When trying the psexec with the -i switch on a remote Windows XP machine I get the following error: Not enough quota is available to process this command. anyone knows how can I solve this? thanks

Anonymous User -August 17, 2005

I too am not able to use 'net use' with psexec If I type 'net use' in command window of 'testxppc', it returns the list of net mappings If I connect from the SAME pc using 'psexec \\testxppc cmd', and then at the prompt type 'net use', I still have the list of the mappings. If I connect from ANOTHER pc using 'psexec \\testxppc cmd', and then at the prompt type 'net use' , the list is empty. Thanks for any answer.

Anonymous User -August 19, 2005

How to create admin$ share remotely which is must for running the psexec....any help would be highly appreciated...Thanx....Mohit.

Anonymous User -August 25, 2005

Try this...it will definately work...psexec \\sys_name net use.......for watching any network drive mapped..........if u want to map a drive.then use......psexec \\sys_name net use g: \\gstdfd\c$......Mohit

Anonymous User -August 25, 2005

Wonder if anyone will even still read this but.. Having plenty of trouble using PSEXEC.. We began testing it with the MS Remote Desktop Connection software.. My command line is PSEXEC \\computer -u myacct -c -f G:\Directory\msrdpcli.exe The wierd thing, if on the remote machine Im logged in as myself (which has domain admin rights) the install of the RDP client works just fine. Logged on as any of our network users, I can see the process start and stop on the remote machine, but nothing ever gets installed. I dont get how this is supposed to help if I have to run to every remote machine and login. Ive also thrown in the -s flag, as well as the -e flag to no avail.. This morning we decided to test it again and roll out the Flash Player to a machine.. Now this time no matter who was logged in on the remote, PSEXEC just hangs there along with the Flash installer, and whatever wierd temp file we can see being created during it. I dont get it, am i just trying to install files that possibly because of where they go, dont work with PSEXEC?? I would think being the domain admin I should have free reign over it but nada..

monotremata -October 12, 2005

Hi all, well i'm wondering what is (and i quote) : "both the local and remote computers have file and print sharing (i.e., the Workstation and Server services) enabled". where can i set those shares and what do they mean ? Thanks T.

tamir_sal -November 30, 2005

I want to run a perl job on a remote machin,I run "C:\>psexec \\sqlprd-clst1 c:\sqltest.pl" and get "PsExec could not start c:\sqltest.pl on sqlp The system cannot find the file specified." Any thoughts??

ptaylormcp -January 03, 2006

QUIERO DESCARGAR ESTA UTILIDAD PARA SABER SI ME SIRVE O NO

MIgueld -March 24, 2006

jmcpinto (at) gmail (dot) com, Check the version of psexec you are using. Are you running the jobs from different computers/servers with different versions of psexec? Using different versions has the tendency to create "connectivity" issues. Let me know! Thanks, Thomas Mshar ~ axomtechnology (dot) com

thomas.mshar -June 09, 2006

JC Warren, run this command and it will return the requested IP information. psexec \\hostname -s "%windir%\system32\ipconfig" Thanks, Thomas Mshar www.axomtechnology.com

thomas.mshar -June 09, 2006

Hi, I got a problem while executing certain exe files like notepad.exe and another exe which perform execution of another exe (which changes position of cursor on screen). When I execute this file using psexec either on remote or local PC there seems to be no effect even though the console gives message executing the exe ..(seems to get hanged). These exe file run if I call them manually or on command prompt but does not seem to work with psexec even with full path of exe given..any ideas?

Rajeevnair81 -September 19, 2006

I'm sure the article is very useful but I will never know because it would cost me a minimum of $49.95 to read it.

nunyabiznez -April 22, 2007

Hi All I need help with this. I used Psexec the day but after some hourse received this Error Message : Error communicating with PsExec service on tallyjavint. The pipe has been ended CAn you please help with this.

abooysen -May 17, 2007

I'm trying to run the PSExec Tool on a remote server in order to change the System Time. Problem is, this process is being called within a simple bat script and I have concerns exposing sensitive data, such as, Server's Administrator UserName and Password in clear text. I'm trying to run this tool using a regular user account modified with elevated privileges. I believe the only Privilege Usage requirements needed to execute this task are as shown below. As a result, I added the corresponding User Right Assignments to Joe user hoping that would solve the issue. Sadly though, this did not work. Am I missing something else or is my requirement not possible? Thx. Ron SeAssignPrimaryTokenPrivilege (Replace a process- level token) SeCreateTokenPrivilege (Create a token object) SeLoadDriverPrivilege (Load and unload device drivers) SeTakeOwnershipPrivilege (Take ownership of files and other object) SeRestorePrivilege (Restore files and directories) SeSystemEnvironmentPrivilege (Modify firmware environment variables) SeSecurityPrivilege (Manage auditing and security log) SeTcbPrivilege (Act as part of the operating system) SeBackupPrivilege (Backup files and directories) SeSystemtimePrivilege (Change the system time)

RonPerron -September 06, 2007

Good utility. But requires autocomplete(Tab) while using cmd. Can u tell me is there any way to autocomplete in psexec.

asdaqamin -August 14, 2008

Regarding the post by Rajeevnair81 on September 19, 2006: I believe the problem you encountered stems from fact that PSEXEC, per the article, will "redirect console applications' output to the local system". The key phrase being "console applications". Notepad and other programs that have a Graphical User Interface (GUI) are not console-type programs. I too would like some way to initiate/start a GUI-type program on a remote computer that would continue running after my connection to that remote computer has ended. Most "remote control" programs are either of the Window's "Remote Desktop" or VNC approach, or like TelNet/SSH/PSExec approach that seem to fly under the level of a GUI, handling only console output. Great for many, many tasks, but not what I (& perhaps Rajeevnair81) are looking for.

Dan Aquinas -September 18, 2008

I’m trying to run psexec with an exe that contains this line of code: gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight), CopyPixelOperation.SourceCopy); It will hit an exception when run on a remote computer, but runs fine locally. This is the exception: Unhandled Exception: System.ComponentModel.Win32Exception: The handle is invalid at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize) at TakeScreenShot.Program.Main(String[] args) c:\browsershotsexes\TakeScreenShot.exe exited on TestVistaErtang with error code -532459699. Thanks, Eric PS This is all the code for the exe: using System; using System.Collections; using System.Text; using System.Drawing.Imaging; using System.Drawing; using System.Windows.Forms; using System.Runtime.InteropServices; namespace TakeScreenShot { class Program { #region Console Window property stuff [DllImport("kernel32.dll", ExactSpelling = true)] private static extern IntPtr GetConsoleWindow(); private static IntPtr ThisConsole = GetConsoleWindow(); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private const int HIDE = 0; private const int MAXIMIZE = 3; private const int MINIMIZE = 6; private const int RESTORE = 9; #endregion static void Main(string[] args) { ShowWindow(ThisConsole, HIDE); //Hides Console Window Console.WriteLine("Minimizing the Current Console Window..."); System.Threading.Thread.Sleep(2000); Rectangle scrBounds = Screen.GetBounds(new Point(0, 0)); int screenWidth = scrBounds.Width; Console.WriteLine(screenWidth);

EricTang -September 23, 2008

Trying to run an install .exe on a remote PC. How can this be done in passive mode, so that all default options are used and the program installs? So far, I can only get the Welcome Page for the install program to appear. Thanks.

Murdoch07 -October 31, 2008

See also this newer article by Mark Russinovich on PsExec: http://windowsitpro.com/article/articleid/95231/psexec-user-account-control-and-security-boundaries.html or type 95231 in the InstantDoc ID box at the top of this page. Plus, there's also http://windowsitpro.com/article/articleid/50102/let-users-install-software-without-giving-them-administrator-r ights.html or type 50102 into the InstantDoc ID box at the top of this page. Hope this helps!

Caroline from editorial -November 13, 2008

PsExec is gr8!!! further, I need to know how can i use autocomplete of folder names, etc. while using cmd on remote machines.. thanks

nilakshi -November 24, 2008

I am getting the following error code 0. Any idea how to fix this? C:\WINDOWS\system32>psexec \\2.75.221.2 -u administrator -p watchThis ipconfig PsExec v1.95 - Execute processes remotely Copyright (C) 2001-2009 Mark Russinovich Sysinternals - www.sysinternals.com ipconfig exited on 2.75.221.2 with error code 0. C:\WINDOWS\system32>

shilyas -May 15, 2009
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement