Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:15:37+00:00 2026-05-26T22:15:37+00:00

Just recently I’ve started with Microsoft Visual Basic 2010 Express and I am creating

  • 0

Just recently I’ve started with Microsoft Visual Basic 2010 Express and I am creating an application which loads a URL into the browser component.

One of the settings that the user is able to configure is to ‘start the app when windows launches’. When this checkbox is checked and the user saves his preferences I create a shortcut in the microsoft startup folder so the application is ran when windows starts up.

I do so using the following code:

My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
Dim startup As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
IO.File.Copy(Application.ExecutablePath, startup & "\ApplicationName.exe")

The problem is, than when I use the the shortcut that Visual Basic makes on install, located on the desktop or start menu programfolder, it loads the settings defined by the user. But when the shortcut from the startup folder is ran, it loads a completely ‘new’ application sort of, with all the settings on default.

Anybody that knows what I might be doing wrong? I’ve searched the internet alot and also looked on StackOverflow topics like copying app shortcut to startup folder VB (which didn’t work for me)

Any help would be highly appreciated. If you need more info, please ask and I’ll look it up asap.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:15:38+00:00Added an answer on May 26, 2026 at 10:15 pm

    you are not creating a shortcut, you are copying the executable file to the startup folder !!
    this copied executable won’t find a config file near it so it will create a new one ! that’s why it shows default values ..
    to make a shortcut import the “Windows Script Host object model” from the “COM” tab in project->refrences->add…

    Dim oShell As IWshRuntimeLibrary.WshShell
    Dim oShortCut As IWshRuntimeLibrary.WshShortcut
    
    oShell = New IWshRuntimeLibrary.WshShell
    oShortCut = oShell.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Startup) & _
                                                        "\" & GetFileName(Application.ExecutablePath) & ".lnk")
    Dim s = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
    With oShortCut
        .TargetPath = Application.ExecutablePath
        .Arguments = ""
        .WorkingDirectory = GetDirectoryName(Application.ExecutablePath)
    End With
    oShortCut.Save()
    oShortCut = Nothing : oShell = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just recently started diving into Real World Haskell and the book provides some
I just recently started toying with output buffering and seem to have run into
I just recently started having a very severe problem when using WebRequest.Create(string url) I
Just recently upgraded to Visual Studio 2010 SP1 and ASP.NET MVC3, but the only
I just recently started working on a database-heavy Clojure application and am attempting to
I just recently started looking into WatiN and was following the example from http://www.codeproject.com/KB/aspnet/WatiN.aspx
I just recently started learning Java. I have a question which is more about
I just recently installed Server 2008 R2 and Visual Studio 2010 Beta 2. Then
Just recently I dove into the VideoLAN open source project. This was my first
We just recently migrated our web application from .NET 1.1 to .NET 2.0. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.