Working with Damaged Files

Don’t just assume that a damaged or corrupted file is completely useless. In my own experience, in at least 50 percent of the cases, I’ve been able to recover at least some if not all of the file; this success ratio increases with straight text files and some documents such as Word and Works files, WordPad, and so on.

This section explains some smart yet easy-to-use techniques for recovering your work from temporary files.

start sidebar
Work-Arounds Don’t Always Work

Before going into depth on this subject, let me add that even if you’re successful using these techniques to rescue work from corrupted files, it won’t always work. You have to back up your files, and you should do it while they’re in good condition so you have another copy to fall back upon should you encounter a serious problem that corrupts them.

This raises another issue. You now know that there are different levels of backup, including one that simply replaces files that have changed since the last time you backed up your files. Some backup programs overwrite the initially stored versions of files with the updates. Obviously, this isn’t great if your original file worked fine and was backed up in that condition, but now a corrupted version on your system replaces it in your backup files.

For this reason, check your backup software’s documentation for ways to configure the program to keep different file versions separate from one another. As an additional backup, you can also make a separate copy of critical files onto a separate disk each time you update these files. This way, you may have a few versions of a file you can use, if needed, to re-create a fully updated file that can be saved without any corruption.

end sidebar

Recovering Core Windows Files

One mini-disaster that befalls many users is core Windows files that are suddenly missing. These are files that prevent Windows from loading and files that you won’t miss until you load a utility like Control Panel and receive an error message. In either case, Windows won’t be happy or run properly until you’re able to resurrect these missing files.

One of the most frequent causes of such errors is using a disk cleanup program that may unintentionally remove a file or utility you need. But sometimes you can do a number on Windows just by improperly removing applications.

How you recover these critical files depends on what types of files are missing and what protection methods you’re using. You could

  • Restore a backup made at a time before this problem happened, as long as the backup includes the core Windows files.

  • Restore a drive image you created of your system at a previous time. This works best only if the drive image is very recent and you’ve made few if any changes to your system since then.

  • Use System Restore if these are files that would be covered in a restore point (usually the case with core Windows files).

  • Replace your missing Windows file with a fresh copy extracted from the compressed cabinet (.cab) files on your Windows install CD.

The first three of these methods require you to have these features and functions in place before you try to use them. For example, if System Restore isn’t enabled, you can’t restore a restore point.

Extracting Individual Files from the Windows Install CD

Let’s spend a moment talking about how to extract files from the Windows Install CD, since the procedures have changed in Windows XP. However, the command syntax is the same.

The files comprising your Windows installation are (mostly) stored in compressed cabinet files on the Windows install CD. You must use a special command, Expand (in Windows XP) or Extract (in earlier versions of Windows), to extract these files out of their compressed state and put them in place of your missing core Windows file on your hard drive.

While you can do this from the command prompt (the MS-DOS prompt under Start Ø Programs Ø MS-DOS or Start Ø Programs Ø Accessories in earlier versions of Windows), Windows XP limits the use of this command to the Recovery Console. (Chapter 9 discusses the use of the Recovery Console in detail; you must restart your system and load the Recovery Console)

It also helps to know in which cabinet file a particular file is stored. This information can sometimes be gleaned from an error message or looked up in the Microsoft Knowledge Base.

The command syntax for Extract and Expand is as follows:

Extract/Expand [source location:\filename] [/f:filespec] [destination] [/d] [/y]

where

  • source location is the exact name and location of the cabinet file containing the file you want.

  • The /f:filespec option lets you specify the file you want to extract.

  • destination is where you want the file copied to.

  • The /d switch allows you to list the contents of the specified cabinet file without extracting any of its files.

  • The /y switch blocks Windows from prompting you whether or not you want it to overwrite existing versions of the same file.

For example, let’s say you need a copy of the file cdrom sys. Its name tells you it’s part of hardware operations, so in looking at the available cabinet files on your Windows install CD (mostly found in the i386 folder), you decide that driver.cab is probably the best place to begin your search for this file. Of course, in their compressed format, such files have slightly different names, usually replacing the last letter of a filename extension with an underscore (_) character. So you need to look for a file named cdrom.sy_, not cdrom.sys.

The command to check the contents of this .cab file looks like this for most versions of Windows:

Extract /d [drive letter]:\i386\driver.cab |more

or

Expand /d [drive letter]:\i386\driver.cab |more (Windows ME and XP)

click to expand

Note 

The |more option is used to break long lists into individual screens.

After entering the command, check your results to see if the file is indeed listed there, as it should be.

click to expand

To extract the desired file from your Windows CD driver.cab file and install it with its proper, full name to the Windows\System32 folder, type one of the following commands:

Extract [drive letter]:\i386\driver.cab /f:cdrom.sys C:\Windows\System32\Drivers

or

Expand [drive letter]:\i386\driver.cab /f:cdrom.sys C:\Windows\System32\Drivers

Here’s a common example. Whether you realize it or not, all the icons that appear in Control Panel are backed by files with the .cpl file extension. At times, these .cpl files may disappear or become corrupted, and you suddenly find you can’t open that option in Control Panel any longer.

Note 

Copies of your .cpl files are stored on the Windows install CD in the i386 folder.

Let’s say you need to replace the inetcpl.cpl file that opens Internet Options in Control Panel. Use one of the following commands to replace this file:

Extract [drive letter]:\i386\inetcpl.cp_ C:\Windows\System32\inetcpl.cpl

or

Expand [drive letter]:\i386\inetcpl.cp_ C:\Windows\System32\inetcpl.cpl

Recovering Core Application Files

Should you run into a situation where you try to launch a program or application and an error message appears telling you that a core file is missing, your options are usually as follows:

  • Reinstall the application.

  • Copy specific files from the application’s install disk. See the software’s documentation to determine how best to do that.

  • Restore these files from a previous backup or drive image. See your backup or drive-imaging software documentation for details on restoring individual files.

It’s always possible that simply running the Setup or install program for the application will restore the required core files. This method also usually retains the settings you’ve customized since you first installed the software.

However, in more stubborn situations, it may be necessary to do the following:

  1. Use the Add or Remove Programs feature in Control Panel to remove the damaged application.

  2. Choose Start Ø Shutdown Ø Restart.

  3. Once the system has restarted and with nothing else open or running on the desktop, reinstall the application.

Working with Corrupted Zip Files

Zip files are compressed files ending in the .zip file extension. (Special types of Zip files that can be unzipped simply by running the file may end in the extension .exe.) Zip files are usually collections of multiple files—or sometimes just one large file—that have been compressed using a special formula to make them much smaller than their original file size.

The leading cause of corruption of Zip files has to do with how they are transmitted: usually over the Internet. You see them most often with files you download. Line noise or other problems with your Internet connection may damage files in transit as they are being downloaded to your PC. The best recourse is to simply re-download them.

If you download the same file more than once and keep getting a message about a corrupted Zip archive when you try to unzip the file, check the file size of at least two copies you’ve downloaded. Is the corrupted file size always the same? This may indicate that the corruption is on the other end, meaning that the supplier of the Zip file is giving you a damaged copy. If this is on a web site, drop an e-mail to the webmaster (often, this is webmaster@website.com) explaining the problem. If the Zip file was sent to you in e-mail by a friend or associate, tell the person about the problem and ask them to re-zip the file and resend it.

However, if you’re always seeing different file sizes on these corrupted Zip downloads, your Internet connection may be experiencing serious problems. The best way to test this is to download another type of file from another site. If you can download fine from another site, you may again be seeing corruption from the source rather than from anything your connection is causing.

I mentioned a moment ago that Zip files can be created with .exe file extensions. These are known as self-extracting Zip files because you simply click the file to run it, which automatically launches the unzipping process whether or not you have Zip file management software (such as WinZip or FreeZip) installed on a PC.

Should you receive a self-extracting Zip file and you get a “corrupted header” error message when trying to open the file, this probably means the Zip file was created on a system infected with a certain type of computer virus. The very act of trying to open the file, however unsuccessful, could potentially infect your system.

To avoid this, always perform a virus scan on all Zip files you receive, regardless of the file extension. If you fail to do so and you receive a “corrupted header” warning on such a file, immediately run your virus-scanning software and isolate the file that gave you this error. If possible, contact the source of the Zip file to notify them about your results and encourage them to scan their systems.

Note 

If all Zip files report corruption, even ones that you know open fine on another system, consider the possibility that your Zip file management software has a problem. Uninstall and reinstall it.

Recovering Accidentally Deleted Files

The first place to check for unintentionally deleted files is the Recycle Bin in Windows. Unless you’ve disabled this feature, this is where all files deleted within Windows come to rest before they are permanently removed from the system.

In fact, unless and until you go into the Recycle Bin and use the Empty Recycle Bin function, you should be able to find the deleted files there. Sometimes, however, the files are removed from the Recycle Bin because it is configured to keep only a percentage of your available disk space free to act as a repository for “almost gone” files and it automatically empties out some entries.

To recover a previously deleted file from Recycle Bin, take these steps:

  1. Click the Recycle Bin icon on the Windows desktop or choose Start Ø My Computer Ø Recycle Bin.

  2. Locate the deleted file you wish to restore in the list of files.

  3. Right-click the file and choose Restore.

    click to expand

Once the Recycle Bin has been emptied, your files are effectively gone. Review the list of deleted files before emptying the Recycle Bin to be sure you’re not deleting something you might need later.

Note 

There are some exceptions to Recycle Bin and deleted files. For one, any files deleted outside Windows (for example, from the Command Console or when using the Recovery Console) won’t be listed there. Also, when deleting a file, if you click No when asked if you want to send the file to Recycle Bin, the file is simply deleted and does not appear in your deleted file listing.

There are some freeware and shareware utilities that try to restore accidentally deleted files or try to recover files already emptied from the Recycle Bin. These utilities are available for download at sites like Download.com (www.download.com) and Tucows (www.tucows.com). I’ve tried the following utilities with some success:

  • Fast File Undelete (DTI Data; $29.99 shareware; all Windows versions) (www.dtidata.com)

  • GoBack Deluxe (Roxio; $40 shareware; all Windows versions) (www.roxio.com)

  • PC INSPECTOR File Recovery (Convar Europe Ltd.; Shareware demo; Windows 95/98) (www.pcinspector.de/file_recovery/UK/welcome.htm)

  • R-Undelete (R-tools Technology, Inc.; $29.99 shareware; all Windows versions) (www.r-tt.com)

Techniques for Working with Damaged Files

There are tricks you can use in working with corrupted files to try to get some or all of the basic content of the file saved even if you can’t salvage the whole file. How well some of these tricks apply to your situation depends on what type of applications and file formats you use. For example, it can be very difficult to cut and paste parts out of a damaged graphics file and still wind up with something that resembles what you first created. But you may be able to use the cut-and-paste technique effectively with word-processing documents.

Before you start, check the Help file and documentation for the program you’re using. See if the program includes recovery/repair options, something like the recovery options Microsoft Office provides (I’ll explain those in a moment). Such a feature can often be the best tool for working with a damaged file. The availability of recovery options is a good thing to consider when buying new applications.

Make sure you’re opening a damaged file using the right application. Loading a file to a program that doesn’t support the file format can look very much like a corrupted file (“garbage” on the screen) even though the file itself is fine when opened by the correct application. You may want to restart your system and try to load a file again to make sure some problem in your current Windows session isn’t temporarily affecting your PC’s ability to work well with open files.

Warning 

Some of the methods described here will result in the loss of specific formatting within a file. Usually, it takes a far shorter time to reformat the file than to re-create the meat and potatoes of the file. Always check file formatting carefully after any salvage operation.

Cutting and Pasting into a Second File

Let’s assume that you can open a file but each time you save it, the file corruption remains.

If the file contains text or objects that can be cut and pasted, use this technique to cut chunks of content from the damaged file and paste them into a new file within the same application. Figure 13.3 shows a file that you can use this technique with.

click to expand
Figure 13.3: Choose carefully what you copy when cutting and pasting data into a second file.

As you work, take care that you don’t copy any of the “garbage” or symbol characters that were not part of your original file. Moving those with you could carry the corruption into the new file. Also, if the data ends a few lines before the actual end of the file (meaning that something like carriage-return characters separate the start or the end of the file from the top or bottom of the file as you view it), don’t copy these carriage-returns because they might be a source of the corruption. They may contain hidden header or footer information that has been corrupted.

You can use this same method to extract content from the temporary files talked about in the “A Cautionary Tale: Open and Look” sidebar.

When you’re satisfied that you have copied out all the data you can, save the new file under a different filename. Then close both the file and the application. Shut down and restart your PC, reopen the application, and try to open the new file. If the new file opens fine, you’ve successfully recovered its contents. You can then make any needed changes to the formatting.

Saving as Text

Can you open the file at all? If so, and if it’s a word-processing document, try saving the file as straight text (usually an option under File Ø Save As). This removes any special formatting you’ve already established for the file, but you can rescue the file’s basic contents (the text). Here’s an example of how to do this using Microsoft Word:

  1. Launch the application and then load the file you’re having problems with.

  2. Choose File Ø Save As.

  3. From the Save window, click the list box under Save as Type, and select Text Only. Click Save.

    Tip 

    If your application allows you to save in rich text format (*.rtf), you can choose that instead of Text Only. RTF preserves some of the formatting lost to text-only saves.

Trying to Open with Another Program

Do you have another program that can open the type of file you’re having problems with? If so, try to open the corrupted file with that program. Formatting as well as programming differences between the two programs may allow a recalcitrant file to open in the second program but not the first. If the second program opens the file, try saving another copy of the file but with a different filename than the first. A strange character in the filename sometimes prevents a file from being properly opened by certain programs.

Trying to Open the File on Another PC

If you have another PC available to you with the same application installed—or another application that will open the same file type—copy the file to a floppy or send it across the network. Then try to open the file on the other PC. If the file opens fine on the second PC, there may be a problem with that program on the first PC. But it could also reflect slight changes between the systems that permit the second PC to open the corrupted file.

Once the file is open, save another copy of it, preferably with a new filename. Then reverse the process and try to open the new copy on the first system.

Working with Damaged Files in Microsoft Office

Since Microsoft Office, or one of its main components such as Word, is so widely used, let’s discuss the recovery options within Office that can help you salvage some or all of a damaged file.

If you’re using an older version of Office, you won’t have these advanced recovery options available to you. But for other users, these options can often make the difference between a few minutes of fixup vs. re-creating an entire file from scratch.

Office 2000 was the first version of Office to include features for repairing a damaged file. Office XP includes significant improvements to these features. But the true gem of both versions is an auto-recovery option you enable to save copies of your work and to recover the last versions automatically for you in the event of a crash or power outage that closes out your open Office files.

For this, you need to enable the auto-save feature, because it works in concert with the recovery feature in Office to store copies of your file frequently and automatically as you work. Once Office—and especially Word—loads again following a crash, the recovery feature tries to load your files from those saved copies.

To enable this feature, take these steps:

  1. From Word, click Tools Ø Options Ø Save.

  2. Click to check Always Save Backup Copies (Office XP/Word 2002 users will see Always Create Backup Copy).

  3. Click to check Save AutoRecover Info Every and then specify the time period (I would recommend every 3 to 6 minutes). Click OK.

    click to expand

While this works in Office 2000, it’s improved greatly in Office XP to the point where it’s rare for me to lose more than a few sentences after a system crash. (As you may recall from some of the disasters I created in Chapter 9, I had a number of opportunities to try this out.) The moment I load Word after such a crash, a Document Recovery window pops up showing me the files it has recovered. I usually don’t need to do a thing except check the recovered documents and save them as needed. I wish all programs were so accommodating.

One last thing about the Document Recovery window in Word/Office XP: You can select a recovered file from this window and click Show Repairs to learn exactly what changes were made to the file in trying to recover, repair, and make it available to you. The information located here may give you hints as to problems in formatting, for example, that you should check in the document before you save it again.

If all else fails, purchase and download software specifically written to extract data from damaged Office files. One of the best-known sites for this type of software is Office Recovery (www.OfficeRecovery.com). At this site, you’ll see that not just Microsoft Office is covered; you can get tools to help with programs such as Outlook Express and Microsoft Money.

Using Microsoft Office Application Recovery

New in Office XP is Microsoft Office Application Recovery, a tool designed to get into a non-responsive Office application and recover the files that are currently open. This tool works not just for Word, but also for Excel and PowerPoint as well.

If you get into this situation with one of the listed Office programs, simply run the Application Recovery tool by choosing Start Ø All Programs Ø Microsoft Office Tools Ø Microsoft Office Application Recovery.

This won’t necessarily work every time to recover all open and unsaved work, but it’s certainly worth a shot, especially if you’re inclined to simply restart the machine and potentially lose that open work anyway.



PC Disaster and Recovery
PC Disaster and Recovery
ISBN: 078214182X
EAN: 2147483647
Year: 2006
Pages: 140
Authors: Kate J. Chase

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net