How does Windows find the path for executables like iexplore.exe?

If I type iexplore into the run window, it runs Internet Explorer. I presume that means C:\Program Files\Internet Explorer is in my path environment variable, but it's not. I checked both my user variables and my system variables. So how does Windows know where to look for this sort of thing?

I suppose I should mention I'm using Windows 8.1 at the moment.

6

2 Answers

The computer has used Application Registration with this program. To see a list of such executable files, check out HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

e.g.:

reg QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"

That shows the executables. To show more information about then, use:

reg QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" /s

Actually, that is just one of the locations that are checked for executable files. The MSDN page on Application Registration has a section called “Finding an Application Executable”, which mentions this as well as some other locations that can get used by the “ShellExecuteEx” function. That function is used by some programming code, including the Run dialog box, but may not be what is used by the traditional command prompt, so that is why you may get different results for a specific command (based on where you are trying to run the command from).

You can't run Internet Explorer from the command-line or PowerShell like other programs, because it's executable isn't under C:\Windows\System32. The variable %SystemRoot%references the path C:\Windows\System32, and is where things like Run and Powershell execute programs from by default because their paths start there unless specified otherwise. Internet Explorers execuables are found in:

C:\Program Files\Internet Explorer\iexplore.exe

for 64-bit

and

C:\Program Files (x86)\Internet Explorer\iexplore.exe

for 32-bit

You can execute Internet Explorer with the above paths or put these in a batch file:

%SystemRoot%\explorer.exe "C:\Program Files\Internet Explorer\iexplore.exe"

and:

%SystemRoot%\explorer.exe "C:\Program Files(x86)\Internet Explorer\iexplore.exe"

Hope this helps.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like