Quantcast
PCWorld.com is upgrading some back-end systems. Some site features, such as user registration, may be temporarily unavailable.

Blogs

    Windows Tips

  • Living with Windows is a whole lot easier with the tips, tools, and techniques from Contributing Editor Scott Dunn's bottomless bag of tricks.
  • Subscribe to this blog

Windows Tips: Simplify Disk Maintenance With Custom Shortcuts

Scott Dunn

If you regularly use Microsoft's ScanDisk and Disk Defragmenter utilities, you are probably tired of futzing with dialog box options each time you use the tools. You can avoid this trouble by adding a few command-line parameters and switches to the appropriate shortcuts. Then, the next time you want to check a disk for errors or defragment a drive, just choose the tool from the menu and the rest is automatic. You can also create multiple shortcuts with different command-line options for different purposes--for example, one that prompts you before fixing errors and another that doesn't.

To make ScanDisk and Disk Defragmenter more automatic, right-click the Start button and choose Open or Explore. Locate and select the ScanDisk or Disk Defragmenter shortcut (by default they reside in Start Menu\Programs\Accessories\System Tools). If you want to make a copy of the shortcut, simply click and hold the right mouse button to drag the icon to the location of your choice; then select either Copy Here or Create Shortcut(s) Here. Next, press Alt- Enter to open the icon's Properties sheet. Click the Shortcut tab and then click at the end of the command line in the Target box.

For a ScanDisk shortcut, type a space and then the letter of a drive you want scanned, followed by a colon, as in c:. Repeat for any other drives you want to check. To scan all local (nonnetworked and nonremovable) hard drives, skip the drive-letter parameters and instead type the switch /a (don't forget that every option you add to the command line should be preceded by a space). If you want to make ScanDisk start and stop without prompting you beforehand, enter the /n switch in the command line.

Even if you use the /n switch, ScanDisk may stop to report errors. If you don't want such information, start ScanDisk and check Automatically fix errors. You'll have to click Start and run ScanDisk at least once to make this setting stick. Finally, if you want ScanDisk to run in Preview mode--that is, to find errors but not to fix them--use the /p switch. Be aware, however, that Preview mode can be misleading because it gives the illusion that errors are corrected when in fact they are not. When you're finished, you might have a command line that looks similar to this: c:\windows\scandskw.exe c: d: /n (see FIGURE 1). This example would instruct the utility to check drives C: and D: and then automatically exit when finished.

For the Disk Defragmenter shortcut, you can type individual drive letters (include the colon) into the Target command line, the same as you do for ScanDisk; to defragment all nonnetworked hard drives, simply type the switch /all. If you want to defragment only to ensure that each file is stored contiguously on the disk, and not to consolidate free space, use /u. On the other hand, if you want free space consolidated without defragmenting files, type /q. If you want both file defragmenting and free-space consolidation, /f is the switch to enter (note that /u, /q, and /f are mutually exclusive; use only one). To make Disk Defragmenter start and end without asking for settings or displaying messages, use /noprompt. Finally, if you want to see only the small (default) Defragmenter window, type /concise; otherwise, type /detailed to see the disk map that symbolizes the defragging process. Type only one of these last two--or use neither to obtain the default (concise) view. Your resulting command line might read c:\windows\defrag.exe /all /f /noprompt if you want to defragment all local hard drives and consolidate free space on them, without user interaction, in the default view.

  • Recommend this story?
  • 0 Yes
    0 No

Dell's December Days of Deals

Learn more about the Windows Phone PCWorld Gift Guide

Focus on Personal Productivitysponsored by Microsoft

  • Personal Finance 2.0 These free and fee-based Web services not only aggregate data from your online bank accounts, they give you tools for managing your money.
  • High-Tech Travel Tips Plenty of stories provide advice for elite mobile professionals. But what about you, the unproductive traveler?

People who read this also read:

All PC World Blogs

  • Lenovo Laptop Showcase Find out how Lenovo IdeaPads and Thinkpads balance performance and portability. Visit the Lenovo Resource Center for more info...

Sponsored Links