Download software, read reviews, get tips and support.  
Home   Articles   Forum   Reviews   Downloads   About/Contact

  PC-Net's PC News
Don Watkins

Take Command of the Command Prompt - Take Command of the Command Prompt - The Command Prompt. What It Is and How To Use It. Part III

By Don Watkins



This month we finish up the command prompt tutorial and youíll be ready to deal with the non-Windows interface.

Hey, this is a dense subject and the command prompt confused millions of computer users for many, many years so keep your chin up if you donít get it the first dozen times. Review the previous articles in this series (both 1 and 2) and hang in.

A Word of Caution

The last command weíll take up is the delete command. The command line delete command comes in handy as often Windows will be using a file and wonít allow you to delete it. For instance the cookies index file is always "busy" in Windows and wonít allow you to delete it. However itís never used in plain old DOS and itíll allow you to delete away.

A word of caution: files deleted at the command prompt arenít sent to the recycle bin. There are utilities that allow you to recover them but they assume that nothing has overwritten the space that the file once occupied. I think the Recover product is about as there is in this area and itís worth checking out, especially the free evaluation version, but remember, thereís no guarantee that any tool will get your file back.

Del or Delete. Itís All the Same

The delete command is the word DELETE or the shorter version DEL. Either works just fine. Thus:

del myfile.ext


delete myfile.ext

do exactly the same thing. Remember that any command must be followed by the enter key to actually execute it and send the file into the bit bucket.

Using It

From the previous articles youíll recall that the command prompt doesnít function perfectly with the long file names often found in Windows so be sure and use the DIR command we covered previous to identify the exact file you want to take out. I think itís best to use the exact filename, even if itís a long filename:

del "my report on the stock market.doc"

but you can use the short filename, both work just fine.

Wild and Crazy Guy

The last aspect of the command prompt is probably the most powerful and thatís the wildcard feature, which allows you to do some very serious damage. A wildcard is a special character that covers a whole boatload of files.

For instance:

dir *.doc

shows all files with an extension of .doc, regardless of the actual filename.

dir myfile.*

shows you all files named myfile regardless of the extension.

The wildcard feature can be used in conjunction with any of the file related commands (dir, copy, delete) to eliminate typing. For instance.

copy *.* c:\target

will copy all the files in the current directory to c:\target. Similarly:

del *.*

will delete all the files in the current directory. Ouch!

But it can be handy. There may be cases where you want to delete everything in a folder. Just be sure that you know the results of your actions before you execute them.

Be Careful Out There

So be careful but donít be put off by the command prompt. Of all the things I've taught about computers the command prompt remains the hardest to explain and the most cryptic but it allows you a level of control that youíll never get in Windows. Most likely I've not touched on the specific thing you need to do and, if so, please feel free to drop by the message area and I'll be glad to provide the syntax for a specific situation.

Finally I've not gone over the command line RENAME command. It can use wildcards just as the COPY or DEL command but generally I've found that the RenameMan program is easier to use and does a better job.

Until next time, best in computing.

Back to article index

  PCNet privacy policy    Copyright, 2010.