How to make my program run at startup?

后端 未结 7 1788
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 14:28

I\'m programming a desktop application similar to Google desktop but with my own gadget with vb.net 2008 how can i make my application when the user install it on their comp

7条回答
  •  有刺的猬
    2020-12-15 14:49

    A simple method

    Imports Microsoft.Win32
    
    ...
    
    Dim regKey As RegistryKey
    regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",True)
    regKey.SetValue(Application.ProductName, Application.ExecutablePath)
    regKey.Close()
    

    Hope it helps

提交回复
热议问题