Question : Auto open an HTML depending a condition

In the autorun of a CD, I would like to open Internet Explorer with a specific HTML file on the disc

I prefer to organise all of that in a batch file (command line in Windows)

I need to open a different file based on the version of the IE installed
so the batch file shoudl contain the following logic (pseudocode)

if IE version (found in registry)  >= 6
    open iexplore test.htm
else
   open iexplore test2.htm
end

Two issues here
- how do I write the batch file
- how can I launch Iexplore with a local file

I know that "start test.html" works, but opens the default browser, not necessarily IE
I found that start iexplore http://blablabla.com/test.htm" works, but I can't combine the two

Thanks for your help

Geert

Answer : Auto open an HTML depending a condition

Hi Gertone

You could try the following:

Download and Install AutoIT from http://www.autoitscript.com/autoit3/downloads.shtml, also recommend downloading and installing AutoIT Script Editor Scite (same page).

Once completed:
Open Scite
Copy and Paste the Attached Code below into Scite
Save the File to IEVersion.au3 for example
Now simply right click the IEVersion.au3 file and select Compile Scirpt this will create a file IEVersion.exe within the same folder you saved the IEVersion.au3 file.  Double click to run.

Cheers
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
#NoTrayIcon
#include 
;Path to Internet Explorer
$IE_Path = @ProgramFilesDir & '\Internet Explorer\iexplore.exe'
;Receive File Version from %ProgramFiles%\Internet Explorer\iexplore.exe
$IE_Version = FileGetVersion($IE_Path)
;If IE Version higher or equal to 6.0.0.0 then
If $IE_Version >= '6.0.0.0' Then
;Open IE Window use either a www URL or a local URL (see below)
	_IECreate ('http://www.experts-exchange.com', 0, 1, 1, 0)
Else
;If IE Version is lower then 6.0.0.0 open second URL Window
	_IECreate (@ScriptDir & '\TEST.HTML', 0, 1, 1, 0)
EndIf
Random Solutions  
 
programming4us programming4us