I have come across this great command ‘runas’ in windows . Its just cool
It allows us to run programs with different permissions than the one that we currently logged on provides. It is similar sudo command in unix ( if you’re a UNIX lover, you would know )
Syntax: Just runas/? in windows command prompt. It will show the synax and explains all the parameters required. C:\codedairy>runas/? RUNAS USAGE: RUNAS [ [/noprofile | /profile] [/env] [/netonly] ] /user:
program RUNAS [ [/noprofile | /profile] [/env] [/netonly] ] /smartcard [/user: ] program /noprofile specifies that the user's profile should not be loaded. This causes the application to load more quickly, but can cause some applications to malfunction. /profile specifies that the user's profile should be loaded. This is the default. /env to use current environment instead of user's. /netonly use if the credentials specified are for remote access only. /savecred to use credentials previously saved by the user. This option is not available on Windows XP Home Edition and will be ignored. /smartcard use if the credentials are to be supplied from a smartcard. /user should be in form USER@DOMAIN or DOMAIN\USER program command line for EXE. See below for examples Examples: > runas /noprofile /user:mymachine\administrator cmd > runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc" > runas /env /user:firstname.lastname@example.org "notepad \"my file.txt\"" NOTE: Enter user's password only when prompted. NOTE: USER@DOMAIN is not compatible with /netonly. NOTE: /profile is not compatible with /netonly.
Let’s say we want to run an internet explorer with a different user.
C:\codedairy> C:\codedairy>runas /user:GLOBAL\usr1 "c:\Program Files\Internet Explorer\iexplore.exe" Enter the password for GLOBAL\usr1: XXXXXX Attempting to start c:\Program Files\Internet Explorer\iexplore.exe as user "GLOBAL\usr1" ... C:\codedairy\usr1>
Use the Run As command by using a shortcut
- Click on Start menu – Go to Programs, and then find the shortcut item in the Programs menu.
- If the shortcut is not located in the Programs folder of the Start menu, browse to the correct location of the shortcut.
- Press SHIFT and hold while you right-click the shortcut item and then click Run as.
- In Run As, select the User name and type the Password, and then click OK.
- That’s it. Job done !
Thanks for reading my post. please do not hesitate to post your comments or ask any questions below ( or even you find any mistakes too )