Windows – How to find location of program in “Open With” list

windows 7

I need to remove a program in the Open with list (I need to replace a custom program with a newer version and I don't remember where the .exe file is).

How would I be able to find the location of this program on my computer?

For some reason I cannot find it with application name, even when searching all .exe file. There is no installer for the program, it's just an .exe you put where you want.

Best Answer

The "Open With…" list is stored in the registry in two separate keys. One key stores the list of applications to use for a particular file extension and the other stores the location of a particular application.

You can either look them up in regedit.exe (which I don't suggest as you could accidentally make a change to the registry) or you can query them from the command line:

> reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.php\OpenWithList

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.php\OpenWithList
    a    REG_SZ    Dreamweaver.exe
    MRUList    REG_SZ    ba
    b    REG_SZ    notepad++.exe


> reg query HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command /ve

HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command
    (Default)    REG_SZ    "C:\Program Files\Notepad++\notepad++.exe" "%1"

I've written a very short batch file to do most of the legwork:

@echo off
SET _Ext=%~1
IF "%_Ext%"=="" SET /P _Ext=Enter file extension to query: 
for /f "tokens=2*" %%a in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\%_Ext%\OpenWithList" ^| FIND /v "MRUList"') do (
    echo|set /p=%%b: 
    for /f "tokens=2*" %%g in ('reg query "HKEY_CLASSES_ROOT\Applications\%%b\shell\open\command" /ve ^| FIND /v "MRUList"') do (
        echo %%h
    )
)
Related Question