Wednesday 2 September 2015

50 most useful Command Prompt commands. Part 4

50 most useful Command Prompt commands. Part 4

This issue, Jane Hoskyn reveals 10 ways to check, repair and format hard drives using your PC's oldest tool

31 Command as administrator


We’ll kick off this section with an important tip: most hard drive-related commands will only work if you run the Command Prompt as administrator.

If you’re not running as administrator, and you attempt a command such as ‘chkdsk’ (see below), Windows will chuck an inscrutable chunk of jargon at you: “Access Denied as you do not have sufficient privileges. You have to invoke this utility running in elevated mode”.


In other words, close the Command Prompt and start again properly. Type cmd again into Start, and instead of pressing Enter, right-click Command Prompt in the list and click ‘Run as administrator’ (see screenshot below).

The window will open as usual, but the prompt will be at a new location. Instead of the default C:\Users\your name, it’ll be at C:\WINDOWS\system32, which gives you much deeper access to your system and drives.

32 Check your hard drive


In Command Prompt jargon, the ‘chkdsk’ (check disk) command analyses the ‘integrity’ of a ‘volume’. In other words, it reveals basic information about the drive you’re checking, including whether it’s working as it should.

To check your main hard drive, run the Command Prompt as administrator, type chkdsk at the prompt and then press Enter. First, you’ll be told what type of file system the drive uses; in most cases it will be NTFS.

Then you’ll get swathes of information about your hard drive, including the customised name you’ve given it (if any), how many files it contains, how much space it takes up and - crucially - whether Windows has found any problems in it.

33 Check another drive


You can also use the chkdsk command to run the rule over your PC’s other internal and external drives, including partitions, storage cards and USB sticks.

First, use Windows Explorer to And the assigned letter of the drive. A USB stick might be ‘E:’, for example. To check it’s working properly, plug it into your PC (but don’t open any files on it, or the command won’t work); type chkdsk E: at the prompt, then press Enter.

34 Fix a drive error


If there seem to be errors in a drive, add the parameter ‘/f’ to the command for a closer look. So type chkdsk /f E: and press Enter, and Windows will automatically look for errors in the drive and then apply any available fixes. This may help if, for example, you were having trouble accessing a storage card.

35 See every file in a drive


This time, the parameter is ‘/v’. Using our E: example, type chkdsk /v E: and press Enter to see the name of every file in every directory (folder) on the drive.

36 Run a quicker check


To speed things up when checking a huge drive, use the ‘/i’ parameter (type chkdsk /i E:). This one only works with NTFS drives.

37 Find out all chkdsk parameters


Type chkdsk /? for the full list of parameters. You can also find a list, along with more info, in Microsoft’s TechNet Library (www.snipca.com/17580).

38 Format a drive


First back up all important data, because formatting will erase the drive. Then run chkdsk to find out what type of system the drive is using (eg NTFS). Now type format E: /fs:ntfs (we’re using E: as an example again), press Enter, and then press Y to format.

39 Check hard drive at startup


You can set and stop chkdsk running automatically at Windows startup, using a Registry hack. Create a system restore point first, and find full instructions here: www.snipca.com/17582.

40 Copy floppies


Do you still use floppy disks? Lucky you, because the command ‘diskcopy’ lets you instantly copy everything from one disk to another. Type diskcopy A: B: (using A: and B: as example disks) then press Enter.