Home > Uncategorized > Autostart your application with Windows

Autostart your application with Windows

March 22nd, 2010

This is a frequently asked question and its very easy to implement it in .net.

Code for adding the application to start with windows

Dim regKey As RegistryKey
regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue(Application.ProductName, Application.ExecutablePath)
regKey.Close()

Code for removing the application from startup

Dim regKey As RegistryKey
regKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
regKey.DeleteValue(Application.ProductName)
regKey.Close()

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Uncategorized

  1. No comments yet.
  1. No trackbacks yet.