Forum Moderators: coopster

Message Too Old, No Replies

closing and relaunching internet explorer

         

scoobie

11:07 pm on May 12, 2005 (gmt 0)

10+ Year Member



Hi,

i am trying to write php code that automatically closes and relaunches internet explorer but can't seem to find information on how to do it.

i have a button that when clicked it executes a file but i would also like the users browser to be closed and re-opened automatically.

does anybody know how to do this or have any sample code i could try,

thanks,

scoobie

StupidScript

11:47 pm on May 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not much you can do on a broad level, here. It's highly dependent on the user's operating environment, security settings, etc. For example, here's a bit of code that only works in WinXP:

<?

$sshell=new COM("WScript.Shell");

$doExec=$sshell->Run("iexplore.exe",3,true);

?>

Assuming security is really loose on the user's machine (not likely after SP2), this creates and runs a shell script using WScript, within which the request to run the executable is run.

I got nothing for NT/98/2000/Mac.

You're really into a sensitive area here, scoobie. Running an application on the user's machine from a web page is typically viewed as an EXTREME security hazard, and pretty much everyone will have their settings set to disallow this.

Why do you want to close and reopen the browser, anyway?

StupidScript

4:49 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



only works in WinXP

I should have said

only works from a WinXP server on that server ... not the user's machine, which will never get the instruction to create the new COM object as it will be executed at the server and not on the user's machine

Sorry. ;)

scoobie

1:12 pm on May 14, 2005 (gmt 0)

10+ Year Member



thanks anyway