Search in uioop.blogspot.com

Blog Archive

Friday, November 14, 2008

Run a program as an Administrator through CMD

RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
/user: program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
/smartcard [/user:] program

RUNAS /trustlevel: 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 Vista Home or Windo
ws Vista Starter Editions
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
/showtrustlevels displays the trust levels that can be used as arguments
to /trustlevel.
/trustlevel should be one of levels enumerated
in /showtrustlevels.
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:user@domain.microsoft.com "notepad \"my file.txt\""

LocalComputer
runas /env /user:Administrator "E:\xxx.exe"

NOTE: Enter user's password only when prompted.
NOTE: /profile is not compatible with /netonly.
NOTE: /savecred is not compatible with /smartcard.

No comments:

AVG Internet Security 2013

Total Pageviews

Contributors