Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-01-28
4
Medium Priority
?
2,495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

604 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