VB 修改注册表实现自启动

发布时间:2024-05-13 08:28 发布:上海旅游网

问题描述:

我想在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\
Winlogon\ 下的Userinit键值改为
C:\WINDOWS\system32\userinit.exe,我自己程序的路径及程序名,
我的代码是:
Public Function WriteRegValue(ByVal KeyName As String, Caption As String) As Integer
KeyName = HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WindowsNT \ CurrentVersion \ Winlogon \ Userinit
Caption = systemroot & "\system32\userinit.exe," & MyserlfPath & "\" & MyserlfName & ".exe,"
Set Reg = CreateObject("Wscript.Shell")
Reg.RegWrite KeyName, Caption
If Reg.RegRead(KeyName) = Caption Then WriteRegValue = 1
End Function
但是运行后一点效果也没有。为什么捏?
没人!!!????

问题解答:

VB 修改注册表实现自启动这个旅游问答期待您的解答,请登录账号或关注微信公众号回答这个问题。

热点新闻