SU Topics | Previous | Next

SU Examples


su administrator

Starts the default command line in the security context of the first account found with name Administrator.


su administrator eventvwr.exe .

Starts Eventvwr.exe as the Administrator, searching only the local account database for the user Administrator.


su username -v -b

Starts the default command line in the first account found with name username, displaying verbose output related to the creation of the new process. The logon type will be Batch, which requires that user username have the SeBatchLogonRight.


su username "" bristol -cb

Starts the default command line in the account username in domain bristol, but does not create a console window for the new process. Instead, the process uses the current console window.


su username "windbg.exe qslice.exe" bristol -e -l

Starts the command line "windbg.exe qslice.exe". The new process runs in the account username in the domain bristol. The user environment is not prepared for the new process; rather, the environment is inherited from the SU process. This command line does not load the user registry hive for the user username.


su username cmd.exe "" winsta0\default -w

Starts Cmd.exe in the first account found with the name username. The new process runs on the windowstation named winsta0 and desktop named default, which is the user-default interactive windowstation and desktop. This command line does not wait on the new process to exit before returning from SU. Such a command line might be useful if executed from a non-interactive service running in the Local System account.


su username cmd.exe bristol winsta0\mydesktop

Starts Cmd.exe on a windowstation and desktop named winsta0\mydesktop, and switches to that desktop.