By gk.shijin ·
Last time when i used by friend's pen drive my comp was attacked by a virus, which converted all my .avi and .mp3 files to jpeg. I cleaned my system with bitdefender and removed all the viruses found. I tried renaming a few files(to check) but i am back to square one. Again the files got converted to jpeg. And 1 more thing , is there any way we can convert the extension of the files in one shot.

Please help me with this.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Couple of things to check.

by Matthew S In reply to virus

Step 1.

Install a decent anti-virus package.

Step 2.

If you are only dealing with a small quantity of files, suggest fixing manually.

I assume when you say 'converted to JPEG", you mean the file extension was changed by the virus, not actually converted to a JPEG image (which means the original AVI & MP3 is lost).

Before manually changing the file extension in Explorer, you need to turn on visibility to extensions (they are off by default). this is under TOOLS -> OPTIONS, then slect VIEW tab, and clear (untick) HIDE EXTENSIONS FOR KNOWN FILE TYPES.

If you have large quantities of files, without knowing a GUI mass file reanming tool off hand, I would go to a DOS session and do this with a DIR & FOR command combination.

The problem you are going to have is that

you have three files types now using the JPG extensions - JPEG's, MP3's & AVI's. So unless you have them each in their own directory structure, and not all mixed up, you are going to have to manually edit 2 lists to use with the FOR..DO loop to process.

To build a list of all JPG on you PC, open a DOS session (START -> RUN -> type "CMD" & enter)

At the prompt type:

DIR C:\*.JPG /s /b>%userprofile%\JPGList.txt

You will know have a list of every JPG file on you C drive in a text file on your desktop called JPGList.

Open th elist in NOTEPAD (once in suggest gointo to FORMAT menu and ensureing "WORD WRAP" is not ticked)
delete every entry (i.e. whole lines) that is a real JPG or AVI file.
back at the DOS prompt use the following command:

FOR /F "eol=;" %i in (%userprofile%\desktop\JPGList.txt) do @echo ren "%i" "*.mp3"

this will not change anthing, but you should get a list that looks like this:


If the list looks OK, then re-run the previous FOR..DO command without the '@ECHO', and the files will be renamed.

Repeat the process to to fix the AVI files.

Suggest trying this all in a test directory with some copied files 1st (just change the DIR C:\*.jpg, to be the directory with the test files, e.g. DIR C:\TESTDIR\*.jpg".

Other than this, I can only hope someone can suggest a handy GUI util to help. The closest I can think of is to use Windows Search to list all the JPG files, and manually go down the list and rename them.

Collapse -

Don't plug that infected drive back in until it is clean

by seanferd In reply to virus

If the files are not corrupted, but have simply had their extensions changed:

ID3 = mp3
mp4 mpeg4 = mp4
riff avi =avi

Look for these headers in the files to determine which type of file they are. You can do this easily with a free hex editor like Frhed:

There are quite a few links to different versions/forks on this page, but download the one at the very bottom for now. Install this tiny app and use it to open the files in question. To make things easy, click Registry > In All Context Menu in the menu bar. Now you can right-click the files and Open In Frhed. When you are done, you can reverse the procedure to remove this context menu item.

If the files are rather large, you may want to open them from within Frhed by using File > Open Partially. Choose the file, and you will get a dialog box. In the bottom text-entry area, enter 1000. This will ensure enough of the file is opened to see the identifying header info.


If you use a media player like VLC (this doesn't work with WMP), you can open VLC and drag the files onto the program window. If you get video, it is an AVI (or other video file), and if you get music, it's an MP3 (or other sound file).

Related Discussions

Related Forums