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

  • Home
  • SEARCH
  • 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 6156499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:37:13+00:00 2026-05-23T20:37:13+00:00

To make my application to start on Windows sturup I decided to put a

  • 0

To make my application to start on Windows sturup I decided to put a shortcut to Startup folder.

I tried to use:

File.Move(AppDomain.CurrentDomain.BaseDirectory + "ApplicationName.exe", Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "ApplicationName.lnk");

It works, but it moves my shortcut not to the folder I need.

Environment.GetFolderPath(Environment.SpecialFolder.Startup)

works well, it returns:

C:\Users\Germanov\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

But my shortcut appears in

C:\Users\Germanov\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Just 1 folder “behind”.

File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "ApplicationName.lnk");

also works “strange”. It actually deletes this file, but again not in “Startup” folder.

If I try to manually add “\Startup” to the path like this:

Environment.GetFolderPath(Environment.SpecialFolder.Startup) + @"Startup\ApplicationName.lnk"

I get a System.IO.Excseption.

I can’t type this path manually, I neen my application to work at diferent PCs with different versions of Windows. I also can’t use Registry to make my application start with windows startup.

I use Windows 7, Visual Studio 2010, .NET 4.0, this is a WPF project.

Any ideas?

  • 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-23T20:37:15+00:00Added an answer on May 23, 2026 at 8:37 pm

    Did you tried Environment.SpecialFolder.CommonStartup instead of Startup, I don’t know why startup is not working for your requirement. Most of installer package do this for you; why do you want to do this for your self? Any reason not for using Registry?

    I tried this code on my machine

    var startup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup);
    string file = Path.Combine(startup, "MyApp.lnk");
    using (StreamWriter sw = new StreamWriter(file))
    {
    sw.WriteLine("Test");
    }
    

    And its coming on my startup

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My idea is to make an application start automatically when a message from a
I don't know how make my application as auto start application.That is my expectation
On application start I'm creating Config object (Singleton). How could I make Config object
How do you make your application multithreaded ? Do you use asynch functions ?
How do I make my application always use English when displaying win32/.net exceptions messages?
I'm making a windows forms application in c# that will start in windows start
I have a Visual Studio 2010 Windows Forms application in which I start a
I'd like to start an application that makes heavy use of a database, and
In a .NET windows application to to modify a remote machine config file that
I'm using the System.Windows.Forms.WebBrowser , to make a view a-la Visual Studio Start Page.

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.