Solved

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

Posted on 2013-01-28
4
1,589 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

825 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