|
| 1 | +--- |
| 2 | +draft: true |
| 3 | +hot: false |
| 4 | +featured: false |
| 5 | +oldUrl: [] |
| 6 | +lang: en |
| 7 | +id: 202509b-runas-command |
| 8 | +date: 2026-04-08T01:10:46.910Z |
| 9 | +last_modified: 2026-04-08T10:27:00.000Z |
| 10 | +title: >- |
| 11 | + Understanding the runas Command - Running Apps with Another Account Without |
| 12 | + Logging Off |
| 13 | +description: >- |
| 14 | + Learn how to use the Windows runas command to run apps or admin consoles with |
| 15 | + admin rights only when needed, while working mainly as a standard user. |
| 16 | +image: /uploads/blog-esolia-pro-default.png |
| 17 | +image_top: /uploads/blog-esolia-pro-default-top.png |
| 18 | +author: Kabaya |
| 19 | +category: Windows |
| 20 | +tags: |
| 21 | + - Runas |
| 22 | + - AdminRights |
| 23 | + - ITSupport |
| 24 | + - BeginnerFriendly |
| 25 | + - DeviceManager |
| 26 | + - Chrome |
| 27 | + - BusinessEfficiency |
| 28 | + - InternalIT |
| 29 | +comments: {} |
| 30 | +--- |
| 31 | +In day-to-day IT support, situations often come up like: |
| 32 | +“I normally work with a standard user account, but sometimes I need admin rights to uninstall drivers or access admin web consoles.” |
| 33 | +Logging off and switching accounts every time is tedious. That’s where the built-in Windows **runas command** comes in handy. |
| 34 | +It lets you run programs using an admin account only when needed, without changing your main login. |
| 35 | + |
| 36 | +<!--more--> |
| 37 | + |
| 38 | +## What is runas |
| 39 | +* runas is a Windows command that allows you to run a program as a different user. |
| 40 | +* Even if you’re logged in as a standard user, you can launch a program with admin privileges by entering the admin username and password. |
| 41 | +* Think of it like having your own key for normal tasks, but borrowing an admin key to access a locked room when necessary. |
| 42 | + |
| 43 | +> [!NOTE] |
| 44 | +> runas runs the program as another user. It does not automatically handle UAC elevation in all cases. Sometimes you need to use cmd.exe /c as an intermediary. |
| 45 | +
|
| 46 | +## Example 1: Opening Device Manager as an Admin |
| 47 | +In my daily IT support, I sometimes uninstall and reinstall drivers on user PCs. |
| 48 | +To uninstall a device, admin rights are required, so I use runas to open Device Manager: |
| 49 | + |
| 50 | +```cmd |
| 51 | +runas /user:DOMAIN\AdminAccount "cmd.exe /c mmc devmgmt.msc" |
| 52 | +``` |
| 53 | +* DOMAIN\AdminAccount = your admin account (or PCName\Administrator for local accounts) |
| 54 | +* After entering the password, Device Manager opens with admin rights |
| 55 | + |
| 56 | +Why it’s useful: You don’t need to log off and log on as an admin every time, saving time and effort. |
| 57 | + |
| 58 | +## Example 2: Opening Chrome as an Admin |
| 59 | +Sometimes, I need to access admin web consoles like Exchange Admin Center or Intune. |
| 60 | +In those cases, I use runas to launch Chrome with my admin account: |
| 61 | + |
| 62 | +```cmd |
| 63 | +runas /user:admin_account@example.com "C:\ProgramFiles\Google\Chrome\Application\chrome.exe" |
| 64 | +``` |
| 65 | + |
| 66 | +* After entering the password, that Chrome session runs with admin privileges |
| 67 | +* Important: The Chrome installation path (C:\Program Files\Google\Chrome\Application\) may vary depending on the device. Adjust the path as needed. |
| 68 | + |
| 69 | +This lets you stay logged in as a standard user while accessing admin tools only when necessary. |
| 70 | + |
| 71 | +## Common Questions / Tips |
| 72 | +* Can I store the password in a script? → Not recommended. Storing in plain text is a security risk. |
| 73 | +* Can I use /savecred? → Possible, but it has security risks. Always follow your company policy. |
| 74 | +* What about UAC? → runas doesn’t handle all UAC prompts. If you get a 740 error, use cmd.exe /c or consider alternatives like Task Scheduler. |
| 75 | + |
| 76 | +## Practical tips |
| 77 | +* Batch files: Create a .bat for frequently used commands. Double-click and enter the password. |
| 78 | +* Task Scheduler: IT can pre-create admin tasks. Users can run them with a single click. |
| 79 | +* Third-party tools (e.g., PsExec): Useful, but be cautious with passwords and logs. |
| 80 | + |
| 81 | +## Summary |
| 82 | +* runas lets you run programs as another user without logging off. |
| 83 | +* For Device Manager, use cmd.exe /c to avoid the 740 error. |
| 84 | +* Apps like Chrome can also run with admin privileges via runas. |
| 85 | +* Avoid storing passwords in scripts. Follow safe operational rules. |
0 commit comments