Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Starting a process from a Windows Service

Starting a process from a Windows Service

Scheduled Pinned Locked Moved Visual Basic
winformshelpquestionannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dlarkin77
    wrote on last edited by
    #1

    Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows: Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop() Thanks very much, dhartigan

    H S 2 Replies Last reply
    0
    • D dlarkin77

      Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows: Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop() Thanks very much, dhartigan

      H Offline
      H Offline
      H is here
      wrote on last edited by
      #2

      Hello You must allow your service to interact with the desktop. If you go to the properties of the service on the LogOn Tab you must check that item. Hope it helps

      1 Reply Last reply
      0
      • D dlarkin77

        Hi, I am trying to update a Windows Service as follows: * the service uses the Updater Application Block to check for updates to itself. * if updates are found the service should launch a console application and then stop itself * the console application will download the updated files and copy them to the right location and then restart the service My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to. I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application. Is there anything different when starting a process from a service? The code I use is as follows: Dim p As New Process p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe") p.StartInfo.Arguments = My.Application.Info.AssemblyName p.Start() Me.Stop() Thanks very much, dhartigan

        S Offline
        S Offline
        spaceus
        wrote on last edited by
        #3

        you'll need to allow the service to interact with desktop How terrible is wisdom when it brings no profit to the wise

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups