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: Take the Shortcut Route to Instant File Backups

Scott Dunn

Full system backups are the safest way to protect all the files and programs on your hard drive, but the files you need to back up most often are the ones you use every day. Fortunately, it takes just a few minutes to create application shortcuts to back up each file as soon as you finish working with the program.

First, open Notepad or your text editor of choice and type start /w (in Windows 9 x and Me) or start "" /w (in Windows 2000 and XP), followed by a space and the path to the application whose work you want to back up automatically. For example, to back up your Word files in Windows 2000 or XP, your first line might look something like start "" /w "c:\program files\microsoft office\office10\winword.exe" (your path may differ, of course). If your application's path contains spaces or any folder names longer than eight characters, as this example does, be sure to include the path in quotation marks but place your command-line parameters outside the quotes.

Now press Enter, and on the next line type xcopy /m /d /y followed by a space, the path of the files you want to back up, another space, and the path to the device and folder where you store your backups--such as on a Zip disk, an external hard drive, or a network drive. As before, place quotation marks around paths with spaces or with folder names that are longer than eight characters. To continue our example, if you store your Word documents in My Documents, your second line might look something like xcopy /m /d /y "C:\My Documents \*.doc" "d:\backup\doc\" (again, your path may differ). The /m switch ensures that only documents that have the archive attribute are copied. (Applications typically apply this attribute to files when you save them.) The switch then removes this attribute from the file you backed up so that it won't be backed up again until the next time you save it. As an extra precaution, the /d switch ensures that only files newer than those with the same names in the destination folder are copied. The /y switch suppresses prompts to overwrite files during copying.

Choose File, Save As and navigate to a folder where you will store this batch file. Save it with a name like "wordbak.bat", taking care to include the quotation marks so that Notepad doesn't add its default .txt extension. Next, in Explorer locate the .bat file you just saved. Click the right mouse button and drag the .bat file from the Explorer window over the Start button, without releasing the right mouse button. After the Start menu appears, drop the .bat file on an appropriate submenu, and choose Create Shortcut(s) Here. Right-click your new shortcut and choose Properties. Make sure the Program tab (Windows 9 x, Me) or Shortcut tab (Windows 2000, XP) is in front. On the Run drop-down list, choose Minimized (see FIGURE 1). In Windows 9 x and Me, check the Close on exit box. Then click OK.

From now on, when you launch your application from this shortcut, it will open your designated application and wait quietly while you work. When you exit the application, it will back up the files you just worked on (or whatever file types you designated in the batch file).

But what if you tend to open your application not by going to the Start menu but by double-clicking a file in Explorer or in the Start, Documents menu? No problem. Just follow the same steps described above, but add a space followed by %1 to the end of the first line in your batch file. After saving this file, right-click one of the application's data files (or in Windows 9 x, Shift-right-click it) and choose Open With or Open With, Choose Program. Click Browse or Other, and then navigate to your batch file shortcut (in Windows 9 x and Me) or to the batch file itself (in Windows 2000 and XP). Select it and click Open. If you're sure you want to open every data file this way, check the Always use box and click OK. Your document will open in your application and be backed up when you exit.

  • 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

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

Sponsored Links