Click to See Complete Forum and Search --> : Wshshell.sendkeys "%F" not closing browser window


sps2045
05-06-2008, 03:16 PM
This script loads the browser window and runs the asp code but doesn't close the window. I had to try to run the asp code from wscript in order to schedule it . I would rather just run a wscript but it doesnt recognize the Server object in Set Mailer = Server.CreateObject("CDO.Message") and wont send external email outside of our firewall like the asp code does.

' WSH with VBScript
Set WshShell = wscript.CreateObject("wscript.Shell")
WshShell.Run "iexplore http://example.web.com/ldap_customer/date_modified.asp", 9
'sleep for 15 seconds
'WScript.Sleep 15000
'Close the browser
Wshshell.sendkeys "%F"
Wshshell.sendkeys "C"