Directory listings in alternate shell

  • Section(s): Security
  • Published on May 03, 2006.
  • Last Modified on May 03, 2006.
  • Last Modified by MitchTulloch.
  • Rated 1.7 out of 5 based on 3 votes.
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.

About MitchTulloch

Mitch Tulloch was lead author for the Windows Vista Resource Kit from Microsoft Press, which is the book for IT pros who want to deploy, maintain and support Windows Vista in mid- and large-sized network environments. Mitch was also the author of Introducing Windows Server 2008 and technical project lead for the Microsoft Office Communications Server 2007 Resource Kit, both books also from Microsoft Press. For more information on these and other books by Mitch, see http://www.mtit.com .

Share this article


Article not looking right or info is missing? Let us know so that we can fix it: .


Receive all the latest articles by email!

Receive Real-Time & Monthly WindowsNetworking.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a WindowsNetworking.com member!

Discuss your network issues with thousands of other network administrators. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred Firewall & VPN hardware solution?