Find path of standard executable for a given file type in Windows

Solution 1:

Sadly the exe locations are usually defined in the registry for example. I have .txt defined as opening with "notepad++".

So to find what the association of the file is, I'd have to go to:

"Open Control Panel > Control Panel Home > Default Programs > Set Associations".

From there it'd show Notepad++ is my default program.

I'd then have to go to the registry for Notepad++ e.g.:

"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Notepad++"

And see the complete file location there something like:

C:\Program Files\Notepad++

EDIT:

Every program you install typically has a registry associated with it, where it can be configured. Most programs details can be found in:

"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node" (64 bit)
"HKEY_LOCAL_MACHINE\SOFTWARE\" (32 bit)

So you'd need to use regedit.exe to these locations, find your program and view the location of the exe

Solution 2:

You can get this information using two command line tools: assoc and ftype:

help assoc
Displays or modifies file extension associations

help ftype
Displays or modifies file types used in file extension associations

You can combine them to produce information you need:
for /f "delims== tokens=2" %a in ('assoc .pdf') do @ftype %a

Running this directly from command line should give you path and parameters of program registered for .pdf files