PsExec v2.34

By Mark Russinovich

Published: May 25, 2021

Download Download PsTools (3.5 MB)

Introduction

Utilities like Telnet and remote control programs like Symantec's PC Anywhere let you execute programs on remote systems, merely they tin be a pain to gear up up and require that you install client software on the remote systems that you lot wish to admission. PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, consummate with full interactivity for panel applications, without having to manually install client software. PsExec'southward most powerful uses include launching interactive command-prompts on remote systems and remote-enabling tools similar IpConfig that otherwise do not take the ability to show information near remote systems.

Annotation: some anti-virus scanners report that one or more than of the tools are infected with a "remote admin" virus. None of the PsTools incorporate viruses, simply they have been used by viruses, which is why they trigger virus notifications.

Installation

Just re-create PsExec onto your executable path. Typing "psexec" displays its usage syntax.

Using PsExec

Meet the July 2004 outcome of Windows IT Pro Magazine for Marker's article that covers advanced usage of PsExec.

Usage:

              psexec [\\computer[,computer2[,...] | @file]][-u user [-p psswd][-n south][-r servicename][-h][-l][-s|-eastward][-x][-i [session]][-c executable [-f|-v]][-due west directory][-d][-<priority>][-a due north,n,...] cmd [arguments]                          
Parameter Description
-a Separate processors on which the application can run with commas where one is the everyman numbered CPU. For instance, to run the application on CPU 2 and CPU 4, enter: "-a ii,iv"
-c Re-create the specified executable to the remote system for execution. If you lot omit this option the application must be in the organisation path on the remote system.
-d Don't wait for process to terminate (non-interactive).
-e Does not load the specified account'southward contour.
-f Copy the specified program even if the file already exists on the remote organisation.
-i Run the plan so that it interacts with the desktop of the specified session on the remote organization. If no session is specified the procedure runs in the console session. This flag is required when attempting to run console applications interactively (with redirected standard IO).
-h If the target organization is Vista or higher, has the process run with the business relationship's elevated token, if bachelor.
-50 Run process as limited user (strips the Administrators group and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.
-due north Specifies timeout in seconds connecting to remote computers.
-p Specifies optional password for user proper name. If you omit this yous will be prompted to enter a hidden password.
-r Specifies the name of the remote service to create or collaborate with.
-due south Run the remote process in the Organisation account.
-u Specifies optional user proper noun for login to remote computer.
-v Re-create the specified file only if it has a higher version number or is newer on than the one on the remote system.
-w Set the working directory of the process (relative to remote reckoner).
-x Display the UI on the Winlogon secure desktop (local system only).
-priority Specifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a unlike priority. Use -groundwork to run at low retentiveness and I/O priority on Vista.
estimator Direct PsExec to run the application on the remote computer or computers specified. If you omit the computer name, PsExec runs the awarding on the local system, and if y'all specify a wildcard (\\*), PsExec runs the command on all computers in the current domain.
@file PsExec will execute the command on each of the computers listed in the file.
cmd Proper name of application to execute.
arguments Arguments to pass (note that file paths must be accented paths on the target system).
-accepteula This flag suppresses the brandish of the license dialog.

Yous can enclose applications that have spaces in their proper noun with quotation marks due east.thou.

              psexec \\marklap "c:\\long name app.exe"                          

Input is but passed to the remote system when you printing the Enter primal. Typing Ctrl-C terminates the remote process.

If yous omit a user name, the process will run in the context of your account on the remote system, but volition non take admission to network resources (because information technology is impersonating). Specify a valid user proper name in the Domain\User syntax if the remote procedure requires admission to network resources or to run in a unlike business relationship. Note that the countersign and command are encrypted in transit to the remote system.

Error codes returned by PsExec are specific to the applications you lot execute, not PsExec.

Examples

This article I wrote describes how PsExec works and gives tips on how to use it:

The following command launches an interactive command prompt on \\marklap:

              psexec -i \\marklap cmd                          

This control executes IpConfig on the remote system with the /all switch, and displays the resulting output locally:

              psexec -i \\marklap ipconfig /all                          

This control copies the plan test.exe to the remote organization and executes it interactively:

              psexec -i \\marklap -c test.exe                          

Specify the full path to a program that is already installed on a remote system if its non on the system's path:

              psexec -i \\marklap c:\bin\examination.exe                          

Run Regedit interactively in the System business relationship to view the contents of the SAM and SECURITY keys::

              psexec -i -d -due south c:\windows\regedit.exe                          

To run Internet Explorer as with limited-user privileges utilize this command:

              psexec -fifty -d "c:\program files\cyberspace explorer\iexplore.exe"                          

Download Download PsTools (iii.5 MB)

PSTools

PsExec is part of a growing kit of Sysinternals command-line tools that assist in the administration of local and remote systems named PsTools.

Runs on:

  • Client: Windows Vista and higher.
  • Server: Windows Server 2008 and college.