Invoke Posted October 28, 2003 Posted October 28, 2003 Hi everyone, I've created a windows service with a timer which opens a IE browser window targeted at a specific page/script. It works if I run the executable itself, however when I install it as a service using InstallUtil and then manually start the service it does not work. Any thoughts, suggestions or fixes would be really helpful. Code from the service.vb file is below. Thanks! Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. Timer1.Enabled = True End Sub Protected Overrides Sub OnStop() ' Add code here to perform any tear-down necessary to stop your service. Timer1.Enabled = False End Sub 'Set variables for use in the Tracker Public Explorer As SHDocVw.InternetExplorer Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed Explorer = New SHDocVw.InternetExplorer Explorer.Visible = True Explorer.Navigate("http://www.microsoft.com") End Sub Quote
Leaders dynamic_sysop Posted October 28, 2003 Leaders Posted October 28, 2003 you need to take a look at the System.Diagnostics.Process class to open your IE window really. ( no need to use SHDocVw.InternetExplorer to open a new IE window ) eg: System.Diagnostics.Process.Start("IEXPLORE.EXE", "http://www.microsoft.com") '/// open a new instance of IE and navigate to your chosen site. Quote
*Gurus* Derek Stone Posted October 28, 2003 *Gurus* Posted October 28, 2003 It's highly likely that it is working but you're simply not noticing. Windows services run on the SYSTEM or Network accounts. Their desktops are separate from yours, and any window created will only be displayed in their context. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.