الاثنين، 19 ديسمبر 2011

Make your programs run on Windows startup

The two best methods for automatically launching a program at startup are to use the registry or the system's Startup folder. Which method you choose depends on how easy you want to make it for the user to remove the program if he or she decides that it shouldn't run at system startup. Using the Startup folder gives the user more control; to prevent the program from running at startup, the user just has to remove its shortcut from the folder. Using the registry makes it less accessible; the user will have to be familiar with the structure of the registry and will have to know how to use an editing tool like RegEdit in order to prevent the application from running at startup.
Sample Code.

'Write to register
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")
regKey.Close()


If you want to remove from register use this code.

regKey.DeleteValue("YourApplicationName", False)

Source: http://vbnetsample.blogspot.com/2008/06/make-your-programs-run-on-windows.html

how to check email how to find an email address how to make an email address how to make a email address how to email how to send an email how to send email how to send a email email from gmail send an email

ليست هناك تعليقات:

إرسال تعليق