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: Check Your Disks for Errors, With a Single Click

Scott Dunn

Command and Control

To make a batch file that always gives the same reply to this prompt, use the pipe symbol (|) to send a y (for yes) or n (for no) to the command on the same line. The full command would look something like this: echo y|chkdsk c: /f /x. Naturally, your drive designation and chosen switches may vary. And you should replace the y with an n if your answer is always no.

To keep the command prompt window from closing after the program executes your batch file, add a final line consisting of a single word: pause. When you launch your batch file, the pause command will hold the command prompt window open so you can see any messages or spot problems. When you're satisfied that all is well, press any key to close the window.

Figure 2: Automate error checking on any or all drives with a simple batch file.After formulating your command line, test it in a command prompt window. Choose Start, Programs (All Programs in XP), Accessories, Command Prompt to open such a window. This is also a good place to learn about additional Chkdsk switches: Type chkdsk /? and press Enter to get the full scoop. Add the switches and commands you prefer to the command line (above the word pause).

If you want your batch file to check more than one disk, press Enter at the end of your first command line, and type another command that designates a different drive. Repeat these steps for each drive that you want your batch file to check.

Finally, choose File, Save As, navigate to the folder where you store your batch files (or to the Windows folder), and give the file a name like "checker.bat" (be sure to include the quotation marks so your text editor won't add its default .txt extension). To launch the disk-check command from the Start menu, locate and select the batch file in Explorer. Use the right-mouse button to drag the file to the Start button, and pause until the menu appears. Drag the file to the submenu of your choice. When the file is over the desired spot, release the mouse button and choose Create Shortcut(s) Here. From now on, when you want to check your disks for errors, just choose your new command from the menu.

The scheduled approach: Now that you've created a batch file for checking your disks, automating the process is simple. Choose Start, Programs (All Programs in XP), Accessories, System Tools, Scheduled Tasks. Double-click the Add Scheduled Task icon. Click Next in the Scheduled Task Wizard dialog box, and then click the Browse button to locate your batch file. Select the file and click Open. Follow the remaining prompts in the Scheduled Task Wizard to make the disk checking occur when you want it to.

  • Recommend this story?
  • 0 Yes
    0 No
  • Great year-end deals
    for small business!
  • Get 24/7 live remote AT&T Tech Support 360* service along with select Lenovo* PCs (with Intel® Core™ 2 Duo processors) and save up to 200!

    Learn more

  • HP EliteBook* 6930p Notebook with Intel® vPro™ technology and a free HP Basic Docking Station - $641 instant savings!

    Learn more

Dell Laptop Deals

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

Sponsored Links