1

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.

3
  • Why dont you do "Always open with" option checked!
    – Umesh
    Nov 23, 2009 at 8:31
  • 1
    Won't work if his uncle isn't an administrator. Nov 23, 2009 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, 2009 at 9:07

3 Answers 3

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.

1
  • 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, 2009 at 9:05
2
Why dont you do "Always open with" option checked! – Umesh

That's the answer, Seems pretty simple.

0

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.

You must log in to answer this question.