Results 1 to 2 of 2

Thread: Launch Application From Windows Service

  1. #1

    Thread Starter
    New Member JDS's Avatar
    Join Date
    Feb 2001
    Location
    Louisiana
    Posts
    7

    Question Launch Application From Windows Service

    I've created a windows service using VB.NET, the service monitors the users actions and should lanuch an application if particular set of conditions have been meet. The problem I'm having is the launch of the windows application from the service. I found an explaination to my problem in MSDN "Process created by the service cannot display a user Interface". I think if I start a new process/thread as the current user not the service I should be able to start my application. My problem...How do you create a new process/thread as the current user?

    If anyone has a solution or idea I would greatly appreciate it. Thanks
    There are 10 types of people in the world:
    Those who understand binary and those who don't.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This creates new thread and run specified job :
    VB Code:
    1. Imports System.Threading
    2.  
    3. Dim thread1 As Thread
    4.     Dim start As Diagnostics.Process
    5.  
    6.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    7.         thread()
    8.     End Sub
    9.     Public Sub thread()
    10.         thread1 = New Thread(AddressOf RunMyapp)
    11.         thread1.Start()
    12.     End Sub
    13.  
    14.     Public Sub RunMyapp()
    15.         Dim str As String = "C:\readme.txt"
    16.         start = New Diagnostics.Process()
    17.         start.Start(str)
    18.     End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width