Friday, July 31, 2009

The Command Prompt.

Us old school types still call this the DOS prompt or DOS shell but everyone has probably seen the infamous black box with that malignant flashing cursor, waiting for you to enter some obscure command to work your sorcery.

In reality the command prompt isn’t that bad if you just read instructions carefully and know some of the secrets. To open a command prompt click Start and Run and type “cmd” and click OK or hit Enter. As usual, the quotes are for separation only and should not be typed. For a listing of the commands you can simply type “help” at the prompt and hit Enter. As usual, the quotes are for separation only and should not be typed. To get the standard commands available just type the utility name followed by a /?, for example “chkdsk /?” (note the space between chkdsk and /).

Speaking of chkdsk, this is likely the command you’ll use most. It’s the command prompt version of the old Windows utility Scandisk. It will check drives for damaged or missing files and replace them if possible, mark bad sectors and attempt to move data to good sectors as well as testing the drive for physical damage.

Using the utility requires you to indicate the drive letter as well as any actions you would like to carry out. For instance, “chkdsk e: /f” will scan drive E: and attempt to fix any errors. The / before a letter indicates a switch, or parameter for the utility to adhere to.

A very handy combo of commands if you find yourself locked off the Internet is:

Ipconfig /flushdns
Netsh winsock reset

Using these back-to-back requires a restart and will likely get you back online. The first flushes the DNS routing tables, which direct you to the appropriate servers and web pages during surfing. The second resets the files required to connect the PC to a network.

You’ll notice that the second command doesn’t use a switch. Netshell (netsh) is one of the few command line tools that don’t require them.

Diskcopy is very handy if you still use floppy disks and want to make some duplicates before valuable diskettes fail. The usage for this one is:

Diskcopy a: a:

This will read and image a floppy disk, then ask you to remove the disk and insert a blank one. It works much like a CD copy through a program like Nero or NTI in Windows and I would strongly suggest its usage to make copies if you use floppies.

PCs running older versions of Windows can often be repaired from a bootable diskette but those little plastic disks have alarming failure rates.

I could go on and on with stuff to use from the C: prompt but many of you would never need many of the things I do. Commands like CD and IF/THEN statements make batch files (a series of commands to carry out multiple tasks) possible and obscure commands like SUBST, NET USE and ATTRIB can make an untenable situation workable.

Just remember the option is there in case of trouble and make use of it if needed. Next week we’ll get back to the Windows tools, so you can reassure your mouse that we haven’t forgotten it.

No comments: