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

The Author — Mitch Tulloch

Mitch Tulloch is a well-known expert on Windows Server administration and cloud computing technologies. He has published over a thousand articles on information technology topics and has written, contributed to or been series editor for over 50 books.

Featured Links