Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My mom and I would like to know how to change the default "open with" command for a .jpeg picture. We are wanting to do this for our uncle who just started using the computer, and we are going to send him a program that we think would be easier for him to use with pictures, but he doesn't want to have to click "open with" each time that he wants to see an image. Is there a way I could write a batch file to send him to change the default program used to view the pictures that have the .jpeg or .jpg file extensions?

He is using Windows XP SP3, and I tried to explain how to use the "properties" to change how files with select extensions are handled but he got lost and I only ended up confusing him more. I really need an auto change method in form of a .exe or batch file.

share|improve this question

migrated from stackoverflow.com Nov 23 '09 at 8:37

This question came from our site for professional and enthusiast programmers.

    
Why dont you do "Always open with" option checked! –  Umesh Nov 23 '09 at 8:31
1  
Won't work if his uncle isn't an administrator. –  Tim Pietzcker Nov 23 '09 at 8:55
    
surely any half decent app will give you an option to take over associations during installation? or from a "preferences" or "options" menu within the app? (although as this will need admin rights it makes more sense to do it during already-elevated install) –  AdamV Nov 23 '09 at 9:07

3 Answers 3

You probably can use ftype:

ftype jpegfile="C:\Program Files\MyCoolViewingProgram\foo.exe" %1

Though I don't know whether there is any guarantee that the .jpg extension will be named jpegfile. If in doubt, run

assoc .jpg=jpegfile
assoc .jpeg=jpegfile

beforehand. You can also replace jpegfile by something else if you wish.

share|improve this answer
    
actually, running "assoc .jpg" on it's onw will tell you if it is currently associated to a filetype called "jpegfile" (in other words, it tells you the type to use in the ftype command) –  AdamV Nov 23 '09 at 9:05
Why dont you do "Always open with" option checked! – Umesh

That's the answer, Seems pretty simple.

share|improve this answer

If this image viewer you speak of, comes in a decent setup package, it should give the option to associate the file types for you.

Otherwise direct him to this Microsoft basic right-click tips article.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.