Could someone help me with “runas” command?

Posted on

Problem :

i am trying to insert text after opening a command prompt.exe. i am trying this with this code
start runas /user:Administrator cmd.exe except i cant use /c after the code for some reason. could someone tell me if there is a solution. please help me.

btw wrote this in a batch file

Solution :

put the invocation and arguments for cmd.exe in double quotes:

runas /user:Administrator "cmd.exe /c tracert" 

if you need double quotes inside the command string, use to escape them:

runas /user:Administrator "notepad "my file.txt""""

Leave a Reply

Your email address will not be published. Required fields are marked *