Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been hit lately by a virus. This virus has randomly renamed alot of files in my computer like videos images and contacts and it made those files without an extension. I've managed to recover some photos with the help of an SO renaming batch file answer. Some files I can not recognize either they're videos or images and couldn't know their formats either. Any help to Detect those files format ? if there's a solution non programatically would be appreciated much.

share|improve this question
This is unlikely to be possible with a non-programming solution. – Ramhound Feb 28 '13 at 17:48
After you've got this sorted with one of the solutions below, go and buy an external hard drive and set up some regular backups. – PhonicUK Mar 1 '13 at 9:47
up vote 13 down vote accepted

TrID may help you identify those files.

  1. Download the program and definitions.
  2. Place them in some directory.
  3. Add that directory to the PATH:
    • Press Win+R,
    • Type systempropertiesadvanced, click OK,
    • Click Environment variables... button and look for PATH in the lower box,
    • Add a semicolon and TrID's directory.
  4. You're now able to run TrID by typing trid in the command line. Examples are available on the program's site.
share|improve this answer
They also provide TrID.NET which gives a GUI interface to the program. – Scott Chamberlain Feb 28 '13 at 18:35
TrID has a really interesting command line option for the OP: the switch -ce renames the files given with the guessed extension. – mpy Feb 28 '13 at 19:07

Some files have their type defined in their innards (it's called a magic number). For example, all windows applications and possibly all DLLs have first two bytes MZ. So sometimes you need to look in HEX editor to tell what is what. Example:

Here is the example

If you can, go download shareware Total Commander, place cursor over any file and hit F3 (View).

But sometimes even that won't help, especially with custom file formats some company might produce, but I hope this helps you a bit.

share|improve this answer
You can use a program like TrID (shown in gronostaj's answer) to scan the file and look up the magic number for you. – Scott Chamberlain Feb 28 '13 at 18:37

You can install kind of a un*x layer via the cygwin environment, and then use the file utility (included in package base), which checks the magic number of a file and can also give some additional informations:

$ file *
img234.png:         PNG image data, 834 x 354, 8-bit/color RGB, non-interlaced
folder:             directory
animation.flv:      Macromedia Flash Video
charmap.pdf:        PDF document, version 1.4
charmap.tex:        LaTeX 2e document, ASCII text
song.mp3:           MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
dvd.iso:            # UDF filesystem data (version 1.5) 'HOLIDAY_SLIDESHOW              '

Indeed, cygwin is rather a over-motorized solution (minimal installation around 20MB) just to run one command, but then you also have a sophisticated CLI... one of the things I miss the most in Windows.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .