要怎麼寫一個刪除
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"xxx"
的程式?
是"刪除"喔!!不是讓它變"空白"'!!
2005-12-03 02:30:05 · 2 個解答 · 發問者 Anonymous in 電腦與網際網路 ➔ 程式設計
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Sub Command1_Click()
Dim hKey As Long, hSubkey As String
hSubkey = "Software\Microsoft\Windows\CurrentVersion\Run"
RegCreateKey HKEY_LOCAL_MACHINE, hSubkey, hKey
RegDeleteValue hKey, "xxx"
RegCloseKey hKey
End Sub
2005-12-03 10:02:15 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋
Private Sub 寫入_Click()
Set RegEdit = CreateObject("WScript.Shell")
RegEdit.RegWrite "HKEY_LOCAL_MACHINE\SoftWare\MicroSoft\Windows\CurrentVersion\Run\PADSEQ", 1& , "REG_DWORD"
End Sub
Private Sub 讀取_Click()
Set RegEdit = CreateObject("WScript.Shell")
MsgBox RegEdit.RegRead("HKEY_LOCAL_MACHINE\SoftWare\MicroSoft\Windows\CurrentVersion\Run\PAD")
End Sub
Private Sub 刪除_Click()
Set RegEdit = CreateObject("WScript.Shell")
RegEdit.RegDelete "HKEY_LOCAL_MACHINE\SoftWare\MicroSoft\Windows\CurrentVersion\Run\PAD"
End Sub
2005-12-03 19:00:37 · answer #2 · answered by ? 5 · 0⤊ 0⤋