You’re asking about the syntax for the RunAs tool. I’ll assume you mean the Windows runas command. Here’s the concise syntax and key options:
Command format
runas [/profile] [/env] [/netonly] /user: “Program”
Main parameters
- /user: — required target user in form User or Domain\User.
- “Program” — command or program (with arguments) to run under that account; wrap in quotes.
- /profile — load the user’s profile (default); omit to skip loading profile for faster start.
- /env — use current environment instead of the target user’s.
- /netonly — credentials are used only for remote access; local process runs under current user but authenticates to remote resources as specified user.
- /savecred — use saved credentials (allows running without entering password). Note: may be disabled for security reasons on some systems.
- /smartcard — use smartcard for authentication.
Examples
- Run Command Prompt as another user:
runas /user:DOMAIN\Admin “cmd.exe”
- Run a program without loading profile:
runas /profile:no /user:User “notepad.exe C:\file.txt”
- Authenticate only for network access:
runas /netonly /user:corp\svcacct “mstsc.exe”
Notes
- You’ll be prompted for the user’s password unless /savecred is used and credentials were previously stored.
- Quoting: if the program and arguments contain spaces, put the whole command in quotes.
- On Windows ⁄11, runas cannot elevate to an administrative token; use “Run as administrator” via UAC or use PsExec/Task Scheduler for elevation.
If you meant a different RunAs tool (Linux sudo/su wrapper or a third‑party utility), tell me which and I’ll provide that syntax.
Leave a Reply