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.

The Author — Mitch Tulloch

Mitch Tulloch is a widely recognized expert on Windows administration, networking, and security. He has been repeatedly awarded Most Valuable Professional (MVP) status by Microsoft for his outstanding contributions in supporting users who deploy and use Microsoft platforms, products and solutions. Mitch has published over two hundred articles on different IT websites and magazines, and he has written or contributed to almost two dozen books and is lead author for the Windows 7 Resource Kit from Microsoft Press. For more information, see www.mtit.com .

Latest Contributions

Featured Links