locked
My Application need to open during windows startup RRS feed

  • Question

  • I have created an vb.net windows form application which must open automatically when windows start after application has been launched(ie. exe file has been placed in C drive ) . This exe folder i need to copy it to many machines,,.. more than 100. So how will i achieve it?

    Tuesday, September 1, 2020 9:35 AM

Answers

  • Here is the code

    My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
    The tricky part is when does the code run? Well you can check to see if the above exists when starting up the application and if not there run the code, otherwise if on a network and you have a service desk have them push out the registry changes when users sign in.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by meeraluv Wednesday, September 2, 2020 8:29 AM
    Tuesday, September 1, 2020 11:48 AM

All replies

  • Hi,

    you should make the machine search for the file they need through a file share, then all you need is to start configure a file share and make the machines listen for a notification through "TCP" using websockets, since they receive the notification it means that the share is ready and that the agent "a service that you develop and put on machines" can download requested files from the file share content.

    I'll try to share a code sample tonight.

    Best regards.

    Tuesday, September 1, 2020 11:17 AM
  • Here is the code

    My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
    The tricky part is when does the code run? Well you can check to see if the above exists when starting up the application and if not there run the code, otherwise if on a network and you have a service desk have them push out the registry changes when users sign in.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by meeraluv Wednesday, September 2, 2020 8:29 AM
    Tuesday, September 1, 2020 11:48 AM