StartUp Folder?!
-
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
-
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
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 theServiceInstaller
andServiceProcessInstaller
classes.Microsoft MVP, Visual C# My Articles
-
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 theServiceInstaller
andServiceProcessInstaller
classes.Microsoft MVP, Visual C# My Articles
Thank You! :)
- Up The Irons, Morten Kristensen