Directory listings in alternate shell

by Mitch Tulloch [Published on 3 May 2006 / Last Updated on 3 May 2006]

How to stop a command from executing in a command shell opened with alternate credentials.

Best practice is to try and have users log onto their desktop computers using non-admin creds instead of as local admins. But not everything works as expected when you are logged on as a non-admin. Here's one more quirk along this line and how to work around it.

Log on as a non-admin and open a command prompt. Then use runas /user:administrator cmd.exe to open a second command shell running with admin creds. Type the following directory listing command to display every file on your C: drive: dir /a /s c:\

While this listing is being displayed, try to stop it by pressing CTRL+C. Nothing happens! If you ever get in a situation like this where you need to stop a command from executing, there is a way though--press CTRL+BREAK instead.

See Also

Featured Links