Windows

10 Windows 7 commands every administrator should know

The command line is often the best place to resolve Windows 7 desktop problems. These basic commands will help speed your troubleshooting tasks.

Holiday rerun: An oldie-but-a-goodie, these command-line basics topped the list of popular troubleshooter posts last year.

PC troubleshooting is becoming less common in larger organizations, but consultants and techs in smaller shops still have to get their hands dirty identifying and fixing desktop problems. Oftentimes, troubleshooting Windows 7 means delving into the command line. Here are 10 fundamental Windows 7 commands you might find helpful.

Before I begin...

This article is intended solely as an introduction to some useful troubleshooting commands. Many of them offer numerous optional switches, which I won't cover here due to space limitations. You can find out more about each command by checking out TechNet's command-line reference.

1: System File Checker

Malicious software will often attempt to replace core system files with modified versions in an effort to take control of the system. The System File Checker can be used to verify the integrity of the Windows system files. If any of the files are found to be missing or corrupt, they will be replaced. You can run the System File Checker by using this command:

sfc /scannow

2: File Signature Verification

One way to verify the integrity of a system is to make sure that all the system files are digitally signed. You can accomplish this with the File Signature Verification tool. This tool is launched from the command line but uses a GUI interface. It will tell you which system files are signed and which aren't. As a rule, all the system files should be digitally signed, although some hardware vendors don't sign driver files. The command used to launch the File Signature Verification tool is:

sigverif

3: Driverquery

Incorrect device drivers can lead to any number of system problems. If you want to see which drivers are installed on a Windows 7 system, you can do so by running the driverquery tool. This simple command-line tool provides information about each driver that is being used. The command is:

driverquery

If you need a bit more information, you can append the -v switch. Another option is to append the -si switch, which causes the tool to display signature information for the drivers. Here's how they look:

driverquery -v
driverquery -si

4: Nslookup

The nslookup tool can help you to verify that DNS name resolution is working correctly. When you run nslookup against a host name, the tool will show you how the name was resolved, as well as which DNS server was used during the lookup. This tool can be extremely helpful when troubleshooting problems related to legacy DNS records that still exist but that are no longer correct.

To use this tool, just enter the nslookup command, followed by the name of the host you want to resolve. For example:

nslookup dc1.contoso.com

5: Ping

Ping is probably the simplest of all diagnostic commands. It's used to verify basic TCP/IP connectivity to a network host. To use it, simply enter the command, followed by the name or IP address of the host you want to test. For example:

ping 192.168.1.1

Keep in mind that this command will work only if Internet Control Message Protocol (ICMP) traffic is allowed to pass between the two machines. If at any point a firewall is blocking ICMP traffic, the ping will fail.

6: Pathping

Ping does a good job of telling you whether two machines can communicate with one another over TCP/IP, but if a ping does fail, you won't receive any information regarding the nature of the failure. This is where the pathping utility comes in.

Pathping is designed for environments in which one or more routers exist between hosts. It sends a series of packets to each router that's in the path to the destination host in an effort to determine whether the router is performing slowly or dropping packets. At its simplest, the syntax for pathping is identical to that of the ping command (although there are some optional switches you can use). The command looks like this:

pathping 192.168.1.1

7: Ipconfig

The ipconfig command is used to view or modify a computer's IP addresses. For example, if you wanted to view a Windows 7 system's full IP configuration, you could use the following command:

ipconfig /all

Assuming that the system has acquired its IP address from a DHCP server, you can use the ipconfig command to release and then renew the IP address. Doing so involves using the following commands:

ipconfig /release
ipconfig /renew

Another handy thing you can do with ipconfig is flush the DNS resolver cache. This can be helpful when a system is resolving DNS addresses incorrectly. You can flush the DNS cache by using this command:

ipconfig /flushdns

8: Repair-bde

If a drive that is encrypted with BitLocker has problems, you can sometimes recover the data using a utility called repair-bde. To use this command, you will need a destination drive to which the recovered data can be written, as well as your BitLocker recovery key or recovery password. The basic syntax for this command is:

repair-bde <source> <destination> -rk | rp <source>

You must specify the source drive, the destination drive, and either the rk (recovery key) or the rp (recovery password) switch, along with the path to the recovery key or the recovery password. Here are two examples of how to use this utility:

repair-bde c: d: -rk e:\recovery.bek
repair-bde c: d: -rp 111111-111111-111111-111111-111111-111111

9: Tasklist

The tasklist command is designed to provide information about the tasks that are running on a Windows 7 system. At its most basic, you can enter the following command:

tasklist

The tasklist command has numerous optional switches, but there are a couple I want to mention. One is the -m switch, which causes tasklist to display all the DLL modules associated with a task. The other is the -svc switch, which lists the services that support each task. Here's how they look:

tasklist -m
tasklist -svc

10: Taskkill

The taskkill command terminates a task, either by name (which is referred to as the image name) or by process ID. The syntax for this command is simple. You must follow the taskkill command with -pid (process ID) or -im (image name) and the name or process ID of the task that you want to terminate. Here are two examples of how this command works:

taskkill -pid 4104
taskkill -im iexplore.exe

About

Brien Posey is a seven-time Microsoft MVP. He has written thousands of articles and written or contributed to dozens of books on a variety of IT subjects.

91 comments
calvinbrock735
calvinbrock735

I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful. http://lady24.com.ua

calvinbrock735
calvinbrock735

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. Snickare

johnpatinson345
johnpatinson345

his is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the excellent work. Buffalo Personal Injury Attorney

calvinbrock735
calvinbrock735

Great, This specific net webpage is seriously thrilling and enjoyment to learn. I’m an enormous fan from the subjects mentioned.fotograf botez

johnpatinson345
johnpatinson345

I also benefit from learning the assessments, but learn that alot of people ought to stay on essay to try and add worth in the direction of the authentic weblog release. Electricistas Madrid

johnpatinson345
johnpatinson345

Yes, great US Military force. Also, in his post you have given a chance to listen about US Military. I really appreciate your work. Thanks for sharing it. video premiere

calvinbrock735
calvinbrock735

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign! Bridal Lehengas

johnpatinson345
johnpatinson345

Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work! winrest

johnpatinson345
johnpatinson345

Good Post, I am a big believer in posting comments on sites to let the blog writers know that they’ve added something advantageous to the world wide web! sexy photoshoot

johnpatinson345
johnpatinson345

It was great to see the old printshop and everyone who works there again. I am excited to see a printing business still operating and growing, great job guys click here

johnpatinson345
johnpatinson345

I agree with your blog and i will be back to check it more in the future so please keep up your work. michael kors outleti love your content & the way that you write. cosmetic surgery in tulsa

johnpatinson345
johnpatinson345

It was great to see the old printshop and everyone who works there again. I am excited to see a printing business still operating and growing, great job guys finanziamenti start up

johnpatinson345
johnpatinson345

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up! muymaduras

johnpatinson345
johnpatinson345

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up! newton ma movers

johnpatinson345
johnpatinson345

I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else! blinds dublin

johnpatinson345
johnpatinson345

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up! Edward Bass New York

johnpatinson345
johnpatinson345

Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work! relationship

johnpatinson345
johnpatinson345

I came onto your blog while focusing just slightly submits. Nice strategy for next, I will be bookmarking at once seize your complete rises hunde

johnpatinson345
johnpatinson345

I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else! Larnaca Airport Transfers

johnpatinson345
johnpatinson345

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up! میزبانی وب

johnpatinson345
johnpatinson345

I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else! Desert Dubai Tour

johnpatinson345
johnpatinson345

I simply want to tell you that I am new to weblog and definitely liked this blog site. Very likely I’m going to bookmark your blog . You absolutely have wonderful stories. Cheers for sharing with us your blog. tetris online game

calvinbrock735
calvinbrock735

"This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog. " 
pinoy channel

calvinbrock735
calvinbrock735

What a blog post!! Very informative and also easy to understand. Looking for more such comments!! Do you have a facebook? I recommended it on digg. The only thing that it’s missing is a bit of new design. replay on youtube

johnpatinson345
johnpatinson345

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. wohnungen

johnpatinson345
johnpatinson345

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! mens shirts

johnpatinson345
johnpatinson345

wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. Free DC Comic Download

johnpatinson345
johnpatinson345

his is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the excellent work. seo company dublin

johnpatinson345
johnpatinson345

wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated. Fachberatung Bremen Familie Beruf

calvinbrock735
calvinbrock735

Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written.foto bugil indonesi

calvinbrock735
calvinbrock735

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job!BH sets

johnpatinson345
johnpatinson345

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. revival meeting

johnpatinson345
johnpatinson345

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. decal dán tường

johnpatinson345
johnpatinson345

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. sp fiber

johnpatinson345
johnpatinson345

Hmm… I read blogs on a similar topic, but i never visited your blog. I added it to favorites and i’ll be your constant reader. ringo star

johnpatinson345
johnpatinson345

It was great to see the old printshop and everyone who works there again. I am excited to see a printing business still operating and growing, great job guys coil packaging line

johnpatinson345
johnpatinson345

I came onto your blog while focusing just slightly submits. Nice strategy for next, I will be bookmarking at once seize your complete rises madbussen

Editor's Picks