PsExec Command Builder

Build PsExec commands to run programs on remote Windows machines.

Advertisement

PsExec Command Builder

PsExec is a lightweight remote-execution tool from Microsoft Sysinternals. It lets you run a program or command on another Windows machine over the network and see the output on your own console, without installing any agent or remote-desktop software on the target. Admins use it to open a remote shell, run diagnostics, or push a quick fix across machines. This builder assembles the command with safe defaults — including leaving the password off the command line.

Use it responsibly

PsExec is powerful and is also widely abused by malware for lateral movement, so EDR and antivirus tools may flag or block it. Use it only on machines you administer, and omit the -p password switch so you are prompted instead of storing the password in your shell history.

Syntax and core options

psexec \\COMPUTER -accepteula [options] command
OptionMeaning
\\COMPUTERTarget hostname or IP (double backslash prefix)
-sRun as the SYSTEM account (highest local privilege)
-iInteractive — show the program UI on the remote session
-cCopy the named program to the remote machine before running
-dDo not wait — start the process and return immediately
-u USERRun as a specific account (you are prompted for the password)
-accepteulaSkip the first-run license dialog (needed for scripting)

Worked examples

psexec \\PC01 -accepteula cmd
psexec \\PC01 -accepteula -s ipconfig /all
psexec \\PC01 -accepteula -u DOMAIN\admin -i powershell

The first opens an interactive Command Prompt on the remote PC. The second runs a command as SYSTEM and returns the output. The third launches PowerShell interactively under a named admin account, prompting for the password rather than embedding it.

Requirements

  • Admin rights on the target and a reachable File and Printer Sharing path — PsExec uses the ADMIN$ share and SMB (TCP 445).
  • The remote machine must be on and not blocking SMB at the firewall.
  • Run your local prompt as Administrator for cross-machine credentials to work.

Tips and pitfalls

  • Never put the password on the command line. Omitting -p makes PsExec prompt for it, keeping it out of history and logs.
  • Use -s only when you genuinely need SYSTEM — it bypasses user-level restrictions.
  • If a connection fails, check that ADMIN$ is reachable and that EDR is not silently quarantining PsExec.
  • For pure PowerShell environments, Invoke-Command over WinRM is often a cleaner, better-logged alternative.

Frequently Asked Questions

What is PsExec used for?+

PsExec is a Sysinternals tool that runs programs and commands on remote Windows machines without installing anything on them. Admins use it to open a remote command shell, run diagnostics, or apply a quick fix across computers, with the output shown on their own console.

How do I run PsExec without exposing the password?+

Leave the -p switch off the command line. When you specify a user with -u but no -p, PsExec securely prompts you for the password at runtime instead of storing it in your shell history or logs, which is the recommended practice.

Why does antivirus flag PsExec?+

PsExec is a legitimate admin tool, but attackers and malware frequently abuse it for lateral movement across a network. Because of that reputation, EDR and antivirus products often flag or block it. Use it only on machines you manage, and expect to allow-list it in your security tooling.

What does the -s flag do in PsExec?+

The -s flag runs the remote command under the local SYSTEM account, the highest-privilege built-in account on the machine. It bypasses user-level restrictions, so use it only when a task genuinely requires SYSTEM rights, such as certain service or registry operations.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.