Create a cmd alias/shortcut for issuing commands on remote computer

Posted on 02.03.18   Batch PsTools RCE Windows

Before we begin, you must:

1) Open your text editor of choice and paste the following code:

C:\path\to\PSTools\PsExec.exe \\%1 cmd /c %2

Correct the path for PsExec.exe. Save it as rce.bat in the %windir%\system32 folder. If not permitted, save it elsewhere and copy it into the system32 folder manually (will probably show UAC prompt).

Fun fact: RCE is short for Remote Code Execution, typically the holy grail of vulnerability exploits

2) Actually there’s no more steps, you’re done.

Lets try it out. Open cmd.exe and run the following command:

rce computername ipconfig

Note that if the command uses several separated words, you must enclose it with ” ”

rce computername "net stats workstation"

 

You might also be interested in this other article showing you how to make a sudo-like command for opening an elevated command prompt:

Create a su command for Windows Command Prompt

More on ITDB

Turn off CTRL + ALT + DEL at login prompt Windows 10


Managing WiFi profiles in Windows 10


Create a cmd alias/shortcut for issuing commands on remote computer


Fix twitchy/wobbling touchpad for Ubuntu based distributions


How to debug a non starting application with ProcMon