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:usuario

    Account the program runs as, such as Administrador or DOMAIN\ana.

  • /savecred

    Saves the password for later use; it is a security risk.

  • /noprofile

    Does not load the user's profile, which speeds up startup.

  • /env

    Uses the current environment instead of the given user's.

  • /netonly

    The credentials are only used to access the network.

Usage examples

  • runas /user:Administrador cmd

    Opens 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 cmd

    Opens 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.

Related commands