runas
Windows CMD · Users and permissions · reference only
What it does
Runs a program with another user's credentials, for example an administrator, without logging out.
Syntax
runas [opciones] /user:usuario "programa"
Options and parameters
/user:usuarioAccount the program runs as, such as Administrador or DOMAIN\ana.
/savecredSaves the password for later use; it is a security risk.
/noprofileDoes not load the user's profile, which speeds up startup.
/envUses the current environment instead of the given user's.
/netonlyThe credentials are only used to access the network.
Usage examples
runas /user:Administrador cmdOpens a console as Administrador after asking for the password.
runas /user:DOMINIO\ana "notepad.exe C:\datos\notas.txt"Opens a file with another account.
runas /noprofile /user:Administrador cmdOpens the console without loading the profile, faster.
runas /netonly /user:DOMINIO\ana "mmc.exe"Uses ana's credentials only for network resources.
Notes and common mistakes
- The password is typed at the command's prompt, not on the command line itself.
- Avoid /savecred: anyone with access to your session could reuse those credentials.