0

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
  • I'm guessing through the Environmental Variable(s) %SystemRoot% and %SystemRoo%\system32 Commented Apr 7, 2017 at 19:38
  • 2
    I attempted to run "iexplorer.exe" from a PowerShell prompt, I was told it was an incorrect command, I attempted to run "notepad.exe" and the program executed. I then switched to the directory and ran "iexplorer.exe" and the program ran. So it actually is in your user's path variable.
    – Ramhound
    Commented Apr 7, 2017 at 19:40
  • 2
    I also ran "iexplorer.exe" from the run command and was told the command was also invalid. So you have changed your path variable from the default (or my user path variable is different) in either case the path IS in the variable otherwise you would get the error. I then provide a path to the executable, and as expected, the program started.
    – Ramhound
    Commented Apr 7, 2017 at 19:44
  • 1
    Isn't it iexplore.exe? That would be why it's returning as an invalid command.
    – Darren
    Commented Apr 7, 2017 at 21:16
  • %SystemRoot% refers to C:\Windows, right? I checked there, and C:\Windows\System32, and didn't see iexplore anywhere. Commented Apr 7, 2017 at 21:30

2 Answers 2

3

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).

0

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
  • I think you may have misunderstood me. I'm not saying I can't get Internet Explorer to run from the run dialog. I'm saying I can. And I'm asking why that is, since it isn't found in %SystemRoot% like you said. It's also strange that I can run it from the run dialog but not from command line. Commented Apr 7, 2017 at 22:46
  • Try it yourself. Press Win+R and type iexplore. Commented Apr 7, 2017 at 22:47
  • Tried it, but it doesn't seem to work. It may function differently on Windows 10. As far as running programs directly from run, I believe there may be a list of pre-defined programs that can be executed this way. It's probably registry-based. Commented Apr 8, 2017 at 4:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .