There seems to be a problem when invoking IE7 from an application and passing parameters with the URL for local files (i.e. files, so the URL is not prefixed with http). It loads up the base file, but all of the parameters go missing!
So, when you call IE7, and pass a URL as an argument to the executable any parameters on the URL are ignored, but only when the URL is local - pages from the web are fine. I have messed with all the security and script settings to no avail.
Here is an example file:
<html>
<body>
<script type="text/javascript">
document.write("OUTPUT<br>");
document.write(location.search);
</script>
</body>
</html>
This file simply displays the parameters passed to it. Save this to C:\temp for example, and try and launch IE, e.g:
C:\Progra~1\Intern~1\IEXPLORE.EXE file://C:/temp/test.html?p=1
All you see is 'OUTPUT' and the address bar does not contain the parameter.
The other common way to start the default web browser is:
rundll32 url.dll,FileProtocolHandler "file://c:/temp/test.html?p=1"
but when IE7 is default you get the same result.
Now, if you change the default browser to Firefox or Opera you do get the correct output!
OUPTUT
?p=1
Just for fun, with IE7 try:
rundll32 url.dll,FileProtocolHandler "http://www.google.com.au/alerts?hl=en"
and note that it works!!!! So this is a problem only for local html files.
Anybody have any ideas or suggestions how I can get around this. I really need to be able to launch local HTML files with parameters (and we can't install a local http server for the job)?
Cheers
Nick
So, when you call IE7, and pass a URL as an argument to the executable any parameters on the URL are ignored, but only when the URL is local - pages from the web are fine. I have messed with all the security and script settings to no avail.
Here is an example file:
<html>
<body>
<script type="text/javascript">
document.write("OUTPUT<br>");
document.write(location.search);
</script>
</body>
</html>
This file simply displays the parameters passed to it. Save this to C:\temp for example, and try and launch IE, e.g:
C:\Progra~1\Intern~1\IEXPLORE.EXE file://C:/temp/test.html?p=1
All you see is 'OUTPUT' and the address bar does not contain the parameter.
The other common way to start the default web browser is:
rundll32 url.dll,FileProtocolHandler "file://c:/temp/test.html?p=1"
but when IE7 is default you get the same result.
Now, if you change the default browser to Firefox or Opera you do get the correct output!
OUPTUT
?p=1
Just for fun, with IE7 try:
rundll32 url.dll,FileProtocolHandler "http://www.google.com.au/alerts?hl=en"
and note that it works!!!! So this is a problem only for local html files.
Anybody have any ideas or suggestions how I can get around this. I really need to be able to launch local HTML files with parameters (and we can't install a local http server for the job)?
Cheers
Nick