PDA

View Full Version : Location of Iexplore.exe?



GreatMarko
06-13-2002, 05:33 PM
I'm trying to read the install location of Internet Explorer from the Registry.
The key I've been using is:
HKEY_CLASSES_ROOT\Applications\iexplore.exe\shell\ open\command

- which returns a value such:
"C:\Program Files\Internet Explorer\iexplore.exe" %1

However, I want this without the "" and %1, i.e.:
C:\Program Files\Internet Explorer\iexplore.exe

..but I'm having a little trouble removing these bits! - can anyone offer any help?

I tried the following:

-- Read From Registry:
Read from Registry (%IEInstallPath% = HKEY_CLASSES_ROOT\Applications\iexplore.exe\shell\ open\command)

-- Get Length
Length of String (%IEPathLength = Length of String "%IEInstallPath%")

-- Remove 1st & last 4 chars:
Mid String (%IEInstallPath% = mid (%IEPathLength%-4) characters of "%IEInstallPath%" starting at 2)

PROBLEM: (%IEPathLength%-4) returns (52-4) and not (48)!

Can anyone help me out, or know of a simpler way to get the location of IE on a users system?

Cheers!

Tim Tester
06-14-2002, 02:42 AM
I'm not sure HKEY_CLASSES_ROOT\Applications\iexplore.exe\shell\ open\command will always give it to you.

I'm sitting at a Win 98 PC with IE 5. The only entries under HKEY_CLASSES_ROOT\Applications (on this PC) are Excel.exe, Notepad.exe & Winword.exe. iexplore does not appear.

You could get a result by starting at HKEY_CLASSES_ROOT\.htm (and following on in certain ways from there), but that would give you the codefile path for the default browser - which is not necessarily IE.