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. C#
  4. StartUp Folder?!

StartUp Folder?!

Scheduled Pinned Locked Moved C#
helpquestionworkspace
3 Posts 2 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.
  • M Offline
    M Offline
    Morten Kristensen
    wrote on last edited by
    #1

    Hi, I am trying to lokalize the "Start Up Folder", in which I need to place/delete files. So that a program will start when Windows starts... I already tried: System.Environment.SpecialFolder ..But that didnt exist :S ? Please help me out :) - Thanks!


    - Up The Irons, Morten Kristensen

    H 1 Reply Last reply
    0
    • M Morten Kristensen

      Hi, I am trying to lokalize the "Start Up Folder", in which I need to place/delete files. So that a program will start when Windows starts... I already tried: System.Environment.SpecialFolder ..But that didnt exist :S ? Please help me out :) - Thanks!


      - Up The Irons, Morten Kristensen

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      It does exist. I'm not sure what you mean by trying to localize it, but all you need to do to get the Startup folder path is:

      string path = Environment.GetFolderPath(
      Environment.SpecialFolder.Startup);

      This will not, however, start when Windows boots. The startup folder is only "used" when a user logs into a Windows session. If you want something to happen when Windows itself starts (i.e., before a user logs in), then you need to write a Windows Service. See the documentation for the ServiceBase class in the .NET Framework SDK for more information and an example. This documentation also contains information about installing Windows Services using the ServiceInstaller and ServiceProcessInstaller classes.

      Microsoft MVP, Visual C# My Articles

      M 1 Reply Last reply
      0
      • H Heath Stewart

        It does exist. I'm not sure what you mean by trying to localize it, but all you need to do to get the Startup folder path is:

        string path = Environment.GetFolderPath(
        Environment.SpecialFolder.Startup);

        This will not, however, start when Windows boots. The startup folder is only "used" when a user logs into a Windows session. If you want something to happen when Windows itself starts (i.e., before a user logs in), then you need to write a Windows Service. See the documentation for the ServiceBase class in the .NET Framework SDK for more information and an example. This documentation also contains information about installing Windows Services using the ServiceInstaller and ServiceProcessInstaller classes.

        Microsoft MVP, Visual C# My Articles

        M Offline
        M Offline
        Morten Kristensen
        wrote on last edited by
        #3

        Thank You! :)


        - Up The Irons, Morten Kristensen

        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