本帖最后由 batman 于 2013-1-14 17:30 编辑
随机启动就是开机自动运行,日期你自己改:- On Error Resume Next
- Dim objSHELL, File, RegPath
- Set objSHELL = CreateObject("Wscript.Shell")
- File = WScript.ScriptFullName
- RegPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\AutoRun"
- objSHELL.RegRead RegPath
- If Err.Number <> 0 Then
- Err.Clear
- objSHELL.RegWrite RegPath, Chr(34) & File & Chr(34), "REG_SZ"
- End If
- Dim BirthDay, NowDay
- BirthDay = "2013-1-14"
- NowDay = DateValue(Now())
- If CStr(NowDay) = BirthDay Then
- Do Until CStr(NowDay) <> BirthDay
- objSHELL.Popup "生日快乐", 5
- WScript.Sleep 1000 * 60 * 10
- Loop
- End If
- Set objSHELL = Nothing
复制代码 取消的批处理代码:- @echo off
- taskkill /f /im "wscript.exe"
- reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v AutoRun /f
复制代码
|