Simplify disk maintenance



Tip
If you use Microsoft's ScanDisk and Disk Defragmenter utilities regularly, you can save yourself the trouble of having to click through dialogue box options each time you run them by adding a few command-line switches to the appropriate Shortcut. Then the next time you want to check a disk or defragment a drive, you simply choose the tool -- the rest is automatic.
To do so, right-click the Start button and choose Open or Explore. Locate and select the ScanDisk or Disk Defragmenter Shortcut, which by default resides in the Windows\Start Menu\Programs\Accessories\System Tools directory. (If you want to make a desktop copy of the Shortcut, right-click to drag the icon to the desktop and choose either Copy Here or Create Shortcut(s) Here.) Press <Alt>-<Enter> to open its Properties sheet. Click the Shortcut tab, then click at the end of the command line in the Target box. Finally, add command-line switches (separated by spaces) as explained below.
ScanDisk. Type the letter of any drive you want scanned, followed by a colon (as in c:). To scan all local (non-networked) hard drives, skip the drive letters and type /a.
To have ScanDisk start and stop without interacting with you, type /n. Even with this switch, ScanDisk may stop to report errors. If you don't want this information, start the program and check Automatically fix errors. You must click Start and run ScanDisk at least once without the /n switch to make this setting stick.
If you want ScanDisk to run in Preview mode -- so it will find errors but not fix them -- use the /p switch. Be aware, however, that Preview mode can be misleading: it gives the illusion that errors are being corrected when in fact they are not.
You might end up with a command line that looks like this:
c:\windows\scandskw.exe c: d: /n
This would check drives C: and D: and then automatically exit when finished.
Disk Defragmenter. As with ScanDisk, you can type individual drive letters followed by a colon. To defragment all non-networked hard drives, type /all.
If you want only to defragment files -- so that each file is stored contiguously on the disk -- and not to consolidate free space, type /u. If you want free space consolidated without defragmenting files, type /q. If you want both the defragmenting and consolidation, type /f. (Note that /u, /q, and /f are mutually exclusive, so you can use only one of these switches at a time.)
To make Disk De-fragmenter start and end without asking you for settings or displaying any messages, type /noprompt.
Finally, if you want to see the disk map that symbolises the defragging process, type /detailed. Otherwise, you'll get the small Defragmenter window by default.
Your final command line might read c:\windows\defrag.exe /all /f /noprompt to defragment and consolidate free space on all local hard drives, without user interaction, in the default view.
- Scott Dunn

Category: Win95
Issue: Apr 1998

These Web pages are produced by Australian PC World © 1997 IDG Communications