Results 1 to 6 of 6

Thread: [RESOLVED] How to add App to run at startup Programmatically(Without Admin Rights)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2013
    Posts
    295

    Resolved [RESOLVED] How to add App to run at startup Programmatically(Without Admin Rights)

    Hi All,

    I have been googling and I'm not able to find an easy way to allow users to add my app to run at startup.

    Is there an easy way?

    -NJ
    Last edited by NJDevils28; Aug 18th, 2017 at 09:25 AM.
    Lo And Behold
    This is my first Microsoft App Submission
    Your opinion of it would be appreciated

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Hoa to add App to run at startup Programmatically

    There is a Registry key that you can add the path of your app to to have it run at startup.

    https://www.bing.com/search?q=vb.net...&setlang=en-GB

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2013
    Posts
    295

    Re: Hoa to add App to run at startup Programmatically

    Quote Originally Posted by jmcilhinney View Post
    There is a Registry key that you can add the path of your app to to have it run at startup.

    https://www.bing.com/search?q=vb.net...&setlang=en-GB
    Thank you for that, I did not find it for some reason with my searches. That's actually pretty easy and straight forward!

    But...My Apologies.

    My Question should have been is there a way to do this without running as Admin? I know that I could give them a pop-up with detailed instructions on how to add the app to the startup directory. But I was hoping to just have them click a button.

    Thank you in advance.

    -NJ
    Lo And Behold
    This is my first Microsoft App Submission
    Your opinion of it would be appreciated

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: How to add App to run at startup Programmatically(Without Admin Rights)

    You can to the Run key under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER but you probably need admin rights in both cases. The other option is to create a shortcut file and place it in the user's Startup folder. That's a bit of a pain because you have to use unmanaged code to create the shortcut.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2013
    Posts
    295

    Re: How to add App to run at startup Programmatically(Without Admin Rights)

    You are correct on both counts it seems.
    I tried the shortcut method and it's not straightforward. Using the MS tutorials messed up all my File.IO code so I scrapped it.

    I may have to supply a pop-up with the run directory and instructions on how to add the shortcut.

    Thanks for your attention to this JMC!

    -NJ
    Lo And Behold
    This is my first Microsoft App Submission
    Your opinion of it would be appreciated

  6. #6
    Lively Member kshadow22's Avatar
    Join Date
    Dec 2014
    Location
    Kentucky
    Posts
    95

    Re: Hoa to add App to run at startup Programmatically

    Quote Originally Posted by jmcilhinney View Post
    There is a Registry key that you can add the path of your app to to have it run at startup.

    https://www.bing.com/search?q=vb.net...&setlang=en-GB
    I have applied this to my app, however, the application requires administrator privileges and every time at startup, the UAC is prompted for my program. How would I go about fixing this? More specifically, I am trying to keep it running as administrator, but not require a prompt.

    I read your comment from "Re: Start with windows (System Tray ONLY) "

    Which is exactly what I need. I am not sure if I am going about the right way of doing this, but this is the code I am using to try to make this possible, is the the most efficient?

    vb.net Code:
    1. Dim CMDsent As String = Command$()
    2.         If Not CMDsent = "" Then
    3.             'Insert Command
    4.         End If
    Last edited by kshadow22; Jul 21st, 2019 at 08:44 AM.

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