Shane Bartholomeusz

Geek and lover of all things tech related

Run a program in context of another user

As a developer, there are many times where we may need to run a program in context of another user. For example, you may need to replicate an issue that a user encountered.

The RUNAS windows command line program is your friend. From the command line run the following command to launch a program in context of another user.

Note: the use of the /netonly switch. The user context is only switched during network communications. The rest of the time, the program operates in the “normal” user context.

runas /netonly /user:<DOMAIN><USERNAME> <PROGRAM_PATH>

E.g. Might not be the best example – but you get the point 🙂

runas /netonly /user:shane-desktopshane “C:\windows\system32\notepad.exe”

Command Line - RUNAS

Shane Bartholomeusz

1 Comment

  1. I don’t know if it’s just me or if everybody else experiencing issues with your blog.

    It seems like some of the text on your content are running off the screen. Can somebody
    else please comment and let me know if this is happening to them as well?
    This might be a problem with my web browser because I’ve
    had this happen before. Appreciate it

Leave a Reply

© 2021 Shane Bartholomeusz

Theme by Anders NorenUp ↑