Solved

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

Posted on 2013-01-28
4
1,478 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
ID: 38828408
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
ID: 38828471
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
ID: 38831266
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
ID: 38882584
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SPAM and Ransomware and Backup 11 87
pdf convertor 7 65
Aero theme is getting disabled. 3 38
Windows 7 Desktop very slow 13 37
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

911 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

16 Experts available now in Live!

Get 1:1 Help Now