In the early days of personal computers there was no graphical Explorer-type interface, no drag and drop, point and click, or any of the other conveniences we now take for granted. Users instead had to learn cryptic text commands to perform even the simplest of PC tasks. It was all very complicated, which is probably why most people now ignore the last remnant of those days: the Windows Command Prompt. In fact, the Command Prompt never went away and is still there, even in Windows Vista. Not only that, but Vista’s prompt is actually an efficient way to enter all kinds of useful commands, many of which performhandy PCmanagement tasks that you simply can’t carry out in any other way. It’s also easy to use and, with just a little practice, anyone can start entering commands and make their PC run more smoothly.
It may look old-fashioned, but the Command Prompt has functionality you won’t find elsewhere. Windows Explorer can’t print a list of all the files in a folder, for example, but with the Command Prompt it’s easy. Hold down shift, right-click on a folder and select Open Command Window Here. A command prompt window will appear, with a prompt telling you the current folder (c:\Users\ YourName\Desktop\FolderName >, for example). Type DIR | CLIP.EXE and press Enter on your keyboard. The DIR command means ‘list everything in this directory’ (or folder); the | symbol is called a pipe, and sends the listing to another program; and CLIP.EXE places the list in the clipboard. Switch back to your Desktop, launch Notepad (Start > All Programs > Accessories > Notepad) and click Edit > Paste to see your files, then save or print them.
Finding folders can sometimes be tricky, especially when they’re deeply embedded, such as c:\programfiles\appname\ data\examples\sample1\look\here. So it’s just as well that the Command Prompt has a solution. Click Start, type cmd.exe in the Search box and press Enter on your keyboard to launch the command prompt. Type SUBST W: "C:\Folder" and press Enter, where W: is replaced by any unused drive letter on your system, and "C:\Folder" is replaced by the path you’d like to access more easily. Now open Explorer and you’ll see a new W: drive. Click that and it will take you directly to C:\Folder (or whichever folder you specified). Browse this or drag and drop files there as you like. When you are done, type SUBST W: /D and press Enter to remove the W: drive, but don’t worry — it is only getting rid of the drive alias; your data remains untouched.
The Command Prompt can help you manage a home network. If you want to turn off your PC but several network users are logged in, then you can send them all a warning with the msg command. Open a Command Prompt, type something like msg * Please log off now, I’m shutting down in five minutes!, press Enter and a pop-up dialogue box with your message will appear on their screens. You can reboot a remote network PC with the Shutdown command. Test by typing shutdown /r /f /m \\ComputerName /c "System will be rebooted in 30 seconds" (replace Computer Name with the name of the PC to restart).
Let’s suppose you connect to the internet via a router. You want to access its configuration program but have forgotten the address. Open a Command Prompt window, type IPCONFIG and press Enter, then look for your network card. Beneath this will be an entry called ‘Default Gateway’, with an IP address. Note this down, type it into your browser — 192.168.1.1, say — and you should see the router’s login dialogue appear. The IPCONFIG report will also tell you your PC’s IP address (this is labelled ‘IPv4 Address’). The command can also fix connectivity problems by clearing your DNS cache. Type IPCONFIG /FLUSHDNS and press Enter to give it a try.
Windows Vista uses the Volume Shadow Copy Service to back up your files. It is a useful but by default takes up 15 per cent of your hard disk. To alter this, click Start, type cmd.exe, right-click the link to cmd.exe that appears in the Start Menu and select Run As Administrator. Type VSSADMIN LIST SHADOWSTORAGE to gain security rights and press Enter to see howmuch disk space is being used. Then enter VSSADMIN RESIZE SHADOWSTORAGE /For=C: /On=C: /Maxsize=10GB to set the maximum available drive space to 10GB, or whatever you would prefer. (If your drive isn’t C, change the letter accordingly.)
Most Command Prompt commands can be tweaked in a number of ways. Type the command’s name followed by /? (as in VSSADMIN /?) to see a list of options. The DIR command is a good example. We have shown how DIR | CLIP.EXE sends a list of the current folder contents to the clipboard, but it can do a lot more. Enter DIR c:\*.PDF /S | CLIP.EXE for instance, and the DIR command will search drive C: for all PDF files, including subfolders, so the clipboard will contain a list of all the PDF files on that drive. Use the /? trick with other commands to find out what they can do, but be careful. Some commands are very powerful, and can overwrite or delete as many files as they find.