vbs 创建注册表关键词

来源:百度知道 编辑:UC知道 时间:2024/05/13 06:51:10
例如:"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\run\
创建一个关键词为NewRun,键值为new.

Dim AutoRunProgram
Set AutoRunProgram=Wscript.CreateObject("Wscript.Shell")
RegPath="HKLM\Software\Microsoft\Windows\CurrentVersion\Run\"
Type_Name="REG_SZ"
Key_Name="NewRun"
Key_Data="d:\abc.exe"
AutoRunProgram.RegWrite RegPath&Key_Name,Key_Data,Type_Name
MsgBox("Success!")

添加d:\abc.exe为自动运行程序
MsgBox("Success!") 为提示成功,不用可删除