ZDNet UK


Skip to Main Content

ZDNet.co.uk - Winner of Best Business Website 2007
  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Jobs
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


Application development Toolkit

Essential DOS

Brien M Posey

Published: 02 Oct 2002 11:59 BST

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Most people know how to use DOS utilities like FORMAT and FDISK, but working with many of the other utilities has become a lost art. Let's take a look at how to use some of the tools contained on the boot disk or boot CD I showed you how to create.

ATTRIB
The ATTRIB.EXE command is critical for working with three types of files in a DOS environment: hidden files, read-only files, and system files. By following the ATTRIB command with a filename; a plus or minus sign; and the letter S, H, or R, you can add or remove the hidden, read-only, and system attributes from a file. For example, if you wanted to make every file in your current directory visible, you could use the command below to remove the hidden attribute:
ATTRIB *.* -h

If you wanted to hide a file that was presently visible, you'd enter the ATTRIB command followed by the file name, the plus sign, and an H. The syntax for working with system files and read-only files is identical. The only difference is that you must substitute the H (hidden) with either R (read-only) or S (system). You can also use multiple switches in conjunction with each other. For example, if you wanted to remove all three attributes from a file named TEST.SYS, you'd enter the following command:
ATTRIB TEST.SYS --S --H -R

CHKDSK
Although CHKDSK has never completely gone away, ScanDisk has overshadowed it. However, I believe the CHKDSK command is the quickest and easiest way to see how much disk space is available and if there are any problems with the disk. Issuing the CHKDSK command by itself generates a report, while entering the CHKDSK /F command repairs any errors that are found.

DELTREE
If you've ever tried to delete a large directory structure from the DOS prompt, you know how tedious it can be. You must remove the contents of each subdirectory individually before you can erase the main directory. For example, suppose you had a directory called LETTERS that contained the sub-directories A, B, and C. Using the normal DOS commands, you'd have to enter the following sequence of commands to remove the LETTERS directory:
CD\LETTERS\A
ERASE *.*
CD..
RD A
CD B
ERASE *.*
CD..
RD B
CD C
ERASE *.*
CD..
RD C
ERASE *.*
CD..
RD LETTERS

The DELTREE command replaces this tedious sequence of commands with a single command. Entering DELTREE LETTERS does the same thing as issuing all of the commands above. DELTREE deletes a directory and everything in it, including subdirectories and their contents.

DISKCOPY
The DISKCOPY command is used to duplicate a floppy disk. To use this command, type DISKCOPY followed by the source drive and the destination drive, then press [Enter]. For example, you might enter DISKCOPY A: A:. After doing so, the DISKCOPY utility will prompt you as to when to insert the source disk (the original media) and the destination disk (the blank media), and will walk you through the copy process.

DOSKEY
The DOSKEY command allows you to repeat commands you've already typed by pressing the up arrow. This is especially handy if you're doing a complex procedure with a lot of repetitive typing. To use the command, simply type DOSKEY once, then press [Enter]. From that point until you reboot the machine, any commands that you enter will be buffered. These commands can be recalled by pressing the up arrow. To recall something entered three commands back, for example, you'd press the up arrow three times.

Next

Previous

1 2


  • Email
  • Trackback
  • Clip Link
  • Print friendlyPrint with Konica

Did you find this article useful?
138 out of 261 people found this useful


Full Talkback thread

0 comments

Company/Topic Alerts

Create a new alert from the list below:

















Discussions

wydeboi wydeboi

Microsoft makes me cry

Monday 13 October 2008, 3:36 AM

3 comments
roger andre roger andre

Unwittingly Working For Google.

Sunday 12 October 2008, 10:49 PM

6 comments
roger andre roger andre

Skype Spying Debacle

Sunday 12 October 2008, 6:43 PM

1 comment

Featured Talkback

In association with Intel
The fact is: Software developers today are really designers and not coders. The reason that business anlaysts exist today to model solutions is because they understand the value of designing software before writing it. All too often developers create code that has little value because they do not understand that business classes interact with other classes within the confines of a working model or pattern.

By: 1000165269

Read full story:
Making sense of agile modelling