1 2 3 4 5 | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '新增 Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) regKey.SetValue("CIM", Application.StartupPath & "\CIMPlugin(BU).exe", RegistryValueKind.String) regKey.Close() End Sub |
1 2 3 4 5 | Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '刪除 Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) regKey.DeleteValue("CIM") regKey.Close() End Sub |
沒有留言:
張貼留言