Solved

How to create BAT file to easily switch default program for file type

Posted on 2013-01-28
4
1,414 Views
Last Modified: 2013-02-12
Recent Firefox plugin updates forced us to download Adobe Reader XI to view PDFs in the browser.  This is creating a problem for us on some websites as we also have Adobe Acrobat X installed for all users.  Some websites won't display correctly unless we change the default programs for PDFs back to Reader.  Simply having Reader open doesn't help "trick" it.

What I'm needing help with is either creating a batch file (maybe with ASSOC or FTYPE comands)...or even just exporting & reimporting registry keys to make this easier & quicker for the user to change.

I tried setting the default app to Acrobat, exporting the registry key for HKEY_CLASSES_ROOT\.pdf then changing the default app to Reader & exported the same key...hoping that all we'd have to do is double click one or the other to toggle the default app...but I don't see a difference in the 2 exported keys when viewing them in Notepad & it doesn't appear to be working.

We're currently using Windows 7 Pro.
0
Comment
Question by:blugirl
  • 2
4 Comments
 
LVL 6

Expert Comment

by:nickinthooz
Comment Utility
ASSOC .Tif=DocuImagExp.exe
FTYPE DocuImagExp.exe="%Programfiles%\DocuCabinet\DocuImagExp.exe" "%%1"

Open in new window


of course change this to pdf and whatever program you want to open the pdf's
0
 

Author Comment

by:blugirl
Comment Utility
Thanks nickinthooz...but I'm not sure if it's working.  I setup the BATs as follows...

ASSOC .PDF=AcroRd32.exe
FTYPE Acrobat.exe="C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" "%%1"

Open in new window


Also...

ASSOC .PDF=Acrobat.exe
FTYPE Acrobat.exe="C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe" "%%1"

Open in new window


When I run ASSOC .PDF in the command prompt, it shows .pdf=AcroRd32.exe &  .pdf=Acrobat.exe, respectively...and I'm making sure that Reader & Acrobat are closed when running the BATs
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
ASSOC and FTYPE only have an effect on opening the files in Windows (e.g. by double-clicking the file in explorer). Acrobat and Reader use a different approach to select which one to use to open files in the browser plug-in. What mechanism are you using to display PDFs in FireFox? You mention a plug-in, which one are you using?
0
 

Author Comment

by:blugirl
Comment Utility
khkremer, thanks for that info.  To view PDFs in FireFox, it forced us to download the "Adobe PDF plugin for FireFox & Netscape".

Since it's only one user that needs to generate the report once a month, I just showed them how to change the default application.

Thanks again for the help though!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now