53

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?

Gareth
  • 19,080
Dan O
  • 635

4 Answers4

39

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

Gareth
  • 19,080
Factor Mystic
  • 13,015
23

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
  • 1,775
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 Wick
  • 6,817
-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 :

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

            @echo off
            echo ------------------------------------------------
            echo * THIS MUST BE RUN AS SYSTEM ( you need administrator)
            echo * example :   psexec -c -i -s ftype_wipe.bat ) 
            echo * be VERY carful when editing/adding extensions
            echo * a backup of the registry is performed just in case too
            echo ------------------------------------------------
            echo This will wipe all users and reg keys for Windows Media Player because ... when has windows media player ever played anything but windows media ...stop jacking what you cant play!
            echo ------------------------------------------------
            echo This is and example command line I use to set VLC as my player for .MOV files
            echo assoc .mov=mov
            echo ftype mov=%CD%\media\VLCPortable\VLCPortable.exe "%%1"
            echo ------------------------------------------------
            echo "rmccurdy.com"
        pause


        echo Backing up registry to %SystemRoot%\temp\

        REG EXPORT HKCR %SystemRoot%\temp\HKCR_%date:~-4,4%%date:~-7,2%%date:~-10,2%.reg
        REG EXPORT HKU  %SystemRoot%\temp\c:\HKU_%date:~-4,4%%date:~-7,2%%date:~-10,2%.reg


        for   %%j IN (.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) do (

        for /f  %%i IN ('wmic path win32_useraccount where "name like '%%'" get sid') do (
        echo wiping %%i %%j 
        reg delete "HKCR\%%j" /f 2> %temp%\null
        reg delete "HKU\%%i\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\%%j" /f 2> %temp%\null
        reg delete "HKU\%%i\%%j" /f 2> %temp%\null
        )

        )

*edit because I got a -1 vote ...