How do I set advanced file associations in Windows 7?

49

19

It used to be in Windows XP that I could make Warcraft III files load automatically into the game by double clicking on them. This association was made by going to file associations ADVANCED area and using this line:

"C:\Program Files\Warcraft III\War3.exe" -loadfile "%1"

Note that it takes an argument and an option.

However, in Windows 7, the "Default Programs" > "Set Associations" area doesn't seem to have this advanced area.

Can I still get these files to open automatically?

Dan O

Posted 2010-04-29T21:17:19.237

Reputation: 595

Answers

36

I'd recommend Default Programs Editor, which can do this and more.

It has full context menu editing, which would allow you to change the command parameters. Plus, it was designed for Vista/7 with UAC support.

Default Programs Editor Context Menu Editing

Default Programs Editor command details

Factor Mystic

Posted 2010-04-29T21:17:19.237

Reputation: 11 212

1It worked for me, and it is portable! – sancho.s Reinstate Monica – 2015-07-30T12:06:26.313

The images in answer doesn't open! – zar – 2017-03-14T21:00:43.313

Note that this program is freeware but mostly closed source (I was not able to find any kind of license on the website and there's no "about" box), the author mentions that it might be steadily released as open source over time. The portions of the code that have been released publicly are released under the BSD license, it's unclear if the rest of the application is under that license as well, but I'd guess that's the case. Also the last activity on his repos was 7/9/2016. – jrh – 2018-07-05T17:13:52.953

Unfortunately, it seems that on Windows 10, OS updates may undo everything this utility does. – jrh – 2018-07-23T20:49:46.717

5a little more clicking, but I actually like this better than my answer +1! – jay – 2013-02-17T08:41:56.920

22

It's probably because I had to much caffeine but.. In command prompt:

 ftype w3file="C:\Program Files\Warcraft III\War3.exe" -loadfile "%1"
 assoc .your_extension=w3file
 regsvr32 /i shell32.dll

:) .. just change the names of the type and extension to the one you need :)

kyrisu

Posted 2010-04-29T21:17:19.237

Reputation: 1 405

You can also look at HKEY_CLASSES_ROOT\SystemFileAssociations.<extension>\shell<program>\command which is where I found the commands were stored when I did a find in the registry. – Mark Ireland – 2015-11-27T15:56:11.443

I also had to remove HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.<extension> to get the ftype to work – Carl Walsh – 2017-07-18T20:14:11.163

Can you add some more information on this especially around what the regsvr32 command does? – busfault – 2017-08-02T15:05:16.287

regsvr32 is used for registering and unregistering dll libraries, /i parameter means 'install' and shell32.dll contains Windows Shell API functions that are used while opening files and URLs. In short, we are setting the new association and then re-registering the library responsible for opening files so it takes into account our new associations. – kyrisu – 2017-08-04T17:15:21.263

11It's worth checking in HKEY_CURRENT_USER\Software\Classes too because user set associations override those set using ftype and assoc :-(

SO ANNOYED with Micro$oft for removing the GUI for this. There are some REALLY common file extensions which require parameters. Java JAR files for example. – mjaggard – 2012-07-26T13:18:35.670

16

What you are looking for is File Type Doctor from Creative Element Power Tools.

You get everything back that they, for some reason, removed from Windows Vista onwards.

File Type Doctor preview

Update: for a more modern and simpler solution check out Factor Mystic's answer!

jay

Posted 2010-04-29T21:17:19.237

Reputation: 6 287

Oh my, that software looks like it would be extremely useful! +1 – afrazier – 2010-04-29T23:08:33.873

Creative Element seem to have some cool tools. Thanks for the link :) – kyrisu – 2010-04-29T23:22:35.977

1Just note that this is Shareware. Check @Factor Mystic's Answer for a free program. – yakatz – 2012-04-26T18:25:54.207

-1

From what I can tell there is no 'easy' way to set file associations in windows. It has always been a pain because you have system level associations and user level associations for EVERY USER on the system... anyway lets stop Windows Media Player for GOOD.

Sick of Windows Media Player always popping up when you click any media? Maybe you have more than one login or app that constantly tries to take over your file associations? Use this script to set them right!

Run as administrator to reset Windows Media Player extensions it hijacks:

These include: .MMS,.WTV,.3G2,.3GP,.ADTS,.AIFF,.ASF,.ASX,.AU,.AVI,.CDA,.M2TS,.m3u,.M4A,.MIDI,.mov,.mp3,.mp4,.MPEG,.TTS,.WAV,.WAX,.wma,.WMD,.WMS,.WMV,.WMZ,.WPL,.WVX

Example of command line I use to set file associations:

Source code to the binary that is just a 7-zip SFX Self Extracting zip with a Windows Batch file in it :

http://rmccurdy.com/scripts/ ftype_wipe.bat.txt

RmccurdyDOTcom

Posted 2010-04-29T21:17:19.237

Reputation: 25