怎么用VB修改注册表

来源:百度知道 编辑:UC知道 时间:2024/05/29 03:30:46
就是不回打开怎么能用VB打开注册表呢?

这是设自动运行的注册表子程序 以作参考
先引用 c:\windows\system32\wshom.ocx
Private Sub SetAutoRun(ByVal Autorun As Boolean)
Dim WshShell As New WshShell
If Autorun Then
WshShell.RegWrite "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\POSTOOL", App.Path & "\" & App.EXEName & ".exe"
Else
WshShell.RegDelete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\POSTOOL"
End If
Set WshShell = Nothing
End Sub