Showing posts with label command line tool. Show all posts
Showing posts with label command line tool. Show all posts

Wednesday, November 23, 2011

Runas Different Credentials In Command Prompt

Sometimes you need to run an executable as a different user via command prompt:
- in scripts
- in Windows 2008 (not 2008 R2), you cannot use shift right click to "run as different user"

Windows come with a command line tool called "runas", which allow users to execute anything as a different user, in the following syntax
runas /user domain\username "full path to exe"

ie.
runas /user domain\username "c:\temp\temp.exe /a /l /r"