|
楼主 |
发表于 2013-7-10 20:10
|
显示全部楼层
Sub poweron_boot()
Dim Fso, CreatVbsFile, w
On error Resume Next
Set w = CreateObject("wscript.shell")
Set Fso = CreateObject("Scripting.FileSystemObject")
CreatVbsFile = w.ExpandEnvironmentStrings("%USERPROFILE%") & "\TimedExcu.vbs"
If w.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\lucky") <> CreatVbsFile or Fso.FileExists(CreatVbsFile) = False Then
w.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\lucky", _
CreatVbsFile
End If
Fso.CopyFile WScript.ScriptFullName, CreatVbsFile, True '为了日后更新程序,所以覆盖原文件
Set w = Nothing
Set Fso = Nothing
End Sub |
|