PhotoRec Sorter

ABOUT

I regularly use PhotoRec to retrieve files from inaccessible file systems for customers, and to make sorting through the rescued files a bit easier I usually organized them by file type (.exe, .pdf, .doc. etc.)Normally I do this with Cygwin and the find command ( find ./ -name \*.pdf -exec mv -v {} ./PDF/ \; ) but I end up having to make directories for each file type extension and run the command once for each file type. I started to right a bash script to speed up the process then realized that AuoItv3 would be much more appropriate and put together this script + stand-alone executable.

Created with AutoIt v3.2.12.1

HOW IT WORKS

After PhotoRec does it’s thing you end up with a bunch of numbered folders prefixed with “recup_dir.” and each folder has different file types (unless you only chose to recovery one file type – in that case this utility is not much use to you).

PhotoRec Sorter (this script) is executed from the same directory as the “recup_dir” folders and moves each file into a new folder matching the name of the file extension (in upper case, ex. PDF, DOC, PPT)

So you end up with all the recovered files being sorted into folders by file extension.

USAGE

Platform: Windows (NT/2K/XP/VISTA) (9x Untested)

After downloading the latest version of PhotoRec Sorter…

  1. Move PhotoRec_Sorter.exe to the directory containing the “recup_dir” folders created by PhotoRec.
  2. Run PhotoRec_Sorter.exe and pay attention to the console output.
  3. Once PhotoRec Sorter has finished executing, be sure to look through the “recup_dir” folders for any files that did not get propery sorted.

DOWNLOAD

PhotoRec Sorter v 1.0.0.9 (Current)

Standalone Executable (.exe)

Executable + AutoIt v3 Source (.zip)

CHANGELOG

Version 1.0.0.9

  • Removes empty “recup_dir” folders after moving files.

Version 1.0.0.8 (Initial release)

  • This release has gone through very limited testing, please comment or contact us if you have any appropriate feedback concerning this release.
  • Must be executed from the directory containing the “recup_dir” folders created by PhotoRec.
  • Moves files created by PhotoRec from “recup_dir” folders into folders by file extension.
  • Leaves original “recup_dir” folders behind – will be cleaned up in upcoming version.
  • Source .au3 file and compiled stand-alone executable are included in this release.

Other PhotoRec sorting Resources: http://www.cgsecurity.org/wiki/After_Using_PhotoRec

16 Responses

  1. [...] Project Page: PhotoRec Sorter Comments RSS | Write Comment | Trackback No Comments [...]

  2. Jason says:

    Hi team
    Any chance in future releases you could consider having a maximum file count per folder and therefor have multiple sub-folders per file type? For instance if photorec retrieves 60 000 jpg files PhotoRec Sorter could create a folder called jpg with a sub-folder called ’1′ in which the first 2000 files are placed, then a second folder called ’2′ is created to accept the next 2000 files and so on. I’ve found this helps speeds viewing significantly.

  3. elkhorn says:

    If the “recup_dir.1” folder (or possibly another) is empty, PhotoRec_Sorter.exe dies with a “file doesn’t exist” error. I was able to get around this by moving another recovered file into the “recup_dir.1”.

    Other than that, it seems to work as advertised. Good work. It was a life-saver.

  4. Eduard says:

    Thanks for the programm, works fine !!! dit you add the new file extensions from 6.11.3 ?

    thanks Ed

    • sam says:

      Thank you! Actually the way the script works it generates the folder names from the files that exist in the “recup_dir” folders so there is no need to maintain a list of possible file extensions.

      -Sam

  5. Krzysztof says:

    I’m afraid, PhotoRecSorter doesn’t work properly.
    It creates a lot of EMPTY folders but doesn’t move/sort ANY files from “recup_dir” folders created by PhotoRec. I don’t understand it… Do You have any sugestion for me, please?

    • sam says:

      My initial guess is that the script is having trouble accessing the files in order to move them.

      Are the file permissions correct?
      Is PhotoRec running while you run PhotoRec Sorter?

      I’m adding logging to the to-do list to improve debugging issues like this.

      Thanks for your feedback, Sam

    • Brian says:

      I am having the same issue. Folders created, but files not moved. I am using Windows 7.

  6. g says:

    wow! this is just magic…all i did was run the sorter where the rec_dir folders are and voila! all the files are sorted…it seems like its a codebreaker though while it was running…lol….thank you guys!..

  7. [...] рассортировать файлы по типам. Для этого пригодится PhotoRec Sorter (скачать). Запускаем PhotoRec_Sorter.exe в той папке, в которой [...]

  8. [...] aber das kann so schlimm nicht mehr werden. Wem ähnliches widerfährt, dem empfehle ich Photorec, PhotoRec Sorter, Namexif und schließlich den guten alten TotalCommander – idealer Weise in dieser [...]

  9. Suresh says:

    Works great…. but in my case it has not recovered the pdf files. It is showing all the files as txt files…

    Any suggestion on how to get my pdf files back? Please help as I have lots of data in pdf format…

  10. Suresh says:

    After recovery it is not showing any .pdf files. Only following formats have been recvored..
    txt,
    gif,
    tx?,
    jpg
    png
    doc
    tz
    png

  11. Suresh says:

    Here I will describe my problem.
    I have an external HDD of 250 GB( Maxtor Basics Portable). It doesn’t have any partitions. It contains around 190 GB data saved from Windows format. and 40 GB free space. Due to the internal HD failure, I had loaded opensuse (linux) in th eremaining free space of 40 GB and booted through it. During opensuse installation it has used 2.0 GB for swap and 20 GB for primary and Linux works well. After installing new Internal HD, I loaded Windows 7 and I connected the external HD and it is showing No data at all. I checked through Disk management, there it showing 22 GB of other file system and 210 GB of unallocated space. First I thought the problem is due to Linux files and then I formatted the 22 GB space( Linux). After Formatting it is showing 22 GB (NTFS. Healthy (Active)) and 210 GB(Healthy, unknown partition). I used PhotoRec to recover the data. I got some data back but not all. I have many pdf files on the hard disk but it didn’t recover any pdf files. Then I used TestDisk to recover the partitions and now it is showing ONE linux swap partition , ONE linux primary partition of large size and ONE HPS-NTFS partition of small size. I tried to recover the HPS-NTFS partition but it showing only System Volume Information. I did’nt get any data.

    Please Help me in this regard, How to get my 190 GB windows data back as it contains some important personal information and Some good books.

    Plz help..
    Thanks in advance..

  12. Louis says:

    cable-up the drive and right click any and all associated drive letters and perform quick format(s). Then photorec.

  13. beyondokc says:

    I love this utility, sorely needed and much appriciated.. a timesaver.

Leave a Reply