1

I have edited a .txt file on Windows 7 with Notepad++ yesterday. Then I put the computer to sleep after saving the document. Today I wasn't able to wake the computer so I restarted it. As soon as I open the file again with Notepad++ I only see "NUL" repeated all over the document on one line and long length (14177 chars). The file is still relatively big (14KB) compared to text documents with little text in them. Notepad doesn't show anything. How do I recover or decode the old version of a possibly corrupted text file? Is it possible to read the bytes of the file and see if they indeed are all null characters? The disk is an SSD.

EDIT1:
- chkdsk was not able to recover the original text.
- Recuva Deepscan found 0 files. Recuva advanced mode with nondeleted results shows the file, but "recover" leads to the corrupted file being recovered.

EDIT2:
- The properties of the corrupted file do not list any previous versions. Windows does not have restore points enabled (because of some drive name issue I can't even enable it).
- The directories in these answers are not found on my system. (Notepad++'s backup options do not seem to be enabled by default.)
- I ran the cmd version of Photorec on .txt files, but my search terms (Windows Explorer content: searches have not found anything yet (perhaps I don't remember the terms, but it's more likely that the file wasn't recovered by PhotoRec).
- I opened the corrupted file with a HEX editor plugin for Notepad++ and all the bits are 0's.

1

If it is SSD drive then maybe turn off TRIM, so it will not clean sectors where the file was located before this issue. I would suggest to create a full clone of your drive and then try restoration process on this clone.

  • Thanks for the suggestion. Given that the system has been running with TRIM enabled for 48h+ and given that PhotoRec and Recuva haven't been able to find the file, do you think that there is still a possibility that your method will be able to find the file? – Wuschelbeutel Kartoffelhuhn Jun 14 '15 at 22:50
  • PhotoRec does not touch disk structure, as long as you stored restored data on other drive. When it comes to trim, system decides when to activate it, so you might be lucky and it might not be executed. I do not know how Recuva works, however I think that it has similar mode to PhotoRec. – Darqer Jun 15 '15 at 7:38
  • After I disable TRIM, do I simply lose a little bit of R/W performance, or are there more significant downsides? Do you have a software recommendation (preferably open source) for trying to recover my text file from the clone? Thanks. – Wuschelbeutel Kartoffelhuhn Jun 15 '15 at 19:09
  • Theoretically you can loose some performance. However you only need to disable trim then clone, restore file and then reenable trim. – Darqer Jun 16 '15 at 18:14
1

As it happens, I had to recover several corrupted files last week and tried Recuva first (didn't find them) and then something called photorec. That's the thing to use, very powerful. When you download their zip make sure you use the win gui version called qphotorec_win.exe (the one just called photorec_win.exe is dos cmd line version and way too cryptic). But when it recovers files, they are generated filenames, not the orginal filenames, so you will have to search through them. Make sure you only select the file type to recover that you need, and not everything. There is one for text. This thing recovered everything I lost. cgsecurity.org/wiki/PhotoRec

Then again maybe you just need to open your corrupted file in binary mode in a text editor like say TextPad or something and examine it.

  • Thanks for the reply. I saw this method in another thread on this superuser site, but unfortunately my search didn't find anything yet.. I updated the post. – Wuschelbeutel Kartoffelhuhn Jun 15 '15 at 0:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.