GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing ss64.com — Runas - Run under a different user account - Windows CMD RUNAS.exeExecute a program under a different user account (non-elevated). Syntax
RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
/user:UserName program
RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
/smartcard [/user:UserName] program
Display the trust levels that can be used:
RUNAS /showtrustlevels
Run a program at a given TrustLevel:
RUNAS /trustlevel:TrustLevel program
Key
/noprofile Do not load the user’s profile.
This causes the application to load more quickly, but
can cause some applications to malfunction.
/profile Load the user’s profile. (default)
/env Use the current environment instead of user’s.
/netonly Use the credentials for remote access only.
/savecred Use credentials previously saved by the user.
/smartcard Load the credentials from a smartcard.
/user UserName in the form USER@DOMAIN or DOMAIN\USER
/trustlevel Level One of levels enumerated in /showtrustlevels.
RunAs is not able to launch an application with an elevated
access token.
program The program to run.
Enter the password when prompted. The RunAs program demands that you type the password manually. This was a conscious design decision. If it were possible to pass the password on the command line, people would start embedding passwords into batch files and logon scripts, which is laughably insecure. [via Raymond Chen] /profile is not compatible with /netonly. When you start a program with RunAs /netonly, the program will execute on your local computer as the user you are currently logged on as, but any connections to other computers on the network will be made using the user account specified. Without /netonly everything will run under the user account specified. The RUNAS command unlike most other CMD and DOS commands requires that it’s command line is quoted, it uses the regular C runtime library command line parser. This also means that RUNAS requires the backslash \ as an escape character, not the standard ^ escape used by other CMD commands. RunAs Reqires the "Secondary Logon" service to be running. The error level %ERRORLEVEL% returned by RunAs: success = 0, failure = 1 Run with Elevated permissions
RunAs from Windows Explorer
RunAs to force a password Sync
ExamplesRun notepad.exe as the user Jdoe on domain SS64dom with no profile:
Run CMD.exe as the Administrator on the local machine Dellpc64:
Run CMD.exe as the current user on domain SS64dom, this will re-authenticate, refreshing any group permissions before running CMD.exe:
Run Notepad.exe as 'Natasha' on domain SS64dom using the current environment, and open a file, escape the quote characters around the filename with \ :
Run Active Directory Users and Computers (dsa.msc) as the user Jdoe on domain SS64dom:
“He who reigns within himself, and rules passions, desires, and fears, is more than a king” ~ Milton Related commandsPsExec - Execute process remotely. Copyright © 1999-2026 SS64.com
Some rights reserved |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |