魔兽采集脚本免费版裸奔用

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

->

请先使用算号器算出匹配当前Windows的序列号,复制并粘贴到下面空格中
热血传奇脚本辅助2016
在上期专栏中,我们向大家介绍了如何禁用LMHosts文件->


Set oShell=CreateObject("Shell.Application")
Set oDir=oShell.BrowseForFolder(0,"选择目录",0)
For Each x In oDir.Items
If LCase(Right(x.Path,4))=".xls" Then
XLS2TXT x.Path
End If
Next
'****************************************************************************************
'开始转换
'****************************************************************************************
Sub XLS2TXT(strFileName)
'若有装Excel只需
'oExcel.ActiveWorkbook.SaveAs strFileName & ".txt", -4158
'下面的方法适合没有装Office的系统
On Error Resume Next
Dim oConn,oAdox,oRecordSet
Set oConn=CreateObject("Adodb.Connection")
Set oAdox=CreateObject("Adox.Catalog")
sConn="Provider=Microsoft.Jet.Oledb.4.0;" & _
"Data Source=" & strFileName & ";" & _
"Extended Properties=""Excel 8.0; HDR=No"";"
sSQL="Select * From "
oConn.Open sConn
if Err Then
Msgbox "错误代码:" & Err.Number & VbCrLf & Err.Description
Err.Clear
else
oAdox.ActiveConnection=oConn
sSQL=sSQL & "[" & oAdox.Tables(0).Name & "]" '为了简便,只处理第一个工作表
Set oRecordSet=oConn.Execute(sSQL)
if Err Then
Msgbox "错误代码:" & Err.Number & VbCrLf & Err.Description
Err.Clear
else
Write strFileName & ".txt",oRecordSet.GetString
end if
end If
oRecordSet.Close
oConn.Close
Set oRecordSet=Nothing
Set oAdox=Nothing
Set oConn=Nothing
End Sub
'****************************************************************************************
'写入文件,同名覆盖,无则创建
'****************************************************************************************
Sub Write(strName,str)
Dim oFSO,oFile
Set oFSO=CreateObject("Scripting.FileSystemObject")
Set oFile=oFSO.OpenTextFile(strName,2,True) '不存在则创建,强制覆盖
oFile.Write str
oFile.Close
Set oFile=Nothing
Set oFSO=Nothing
End Sub
这些名称包括:
  ·常量名
  ·变量名
  ·自定义的类型定义名
  ·模块名
  ·DLL过程声明名
  对工程名表总大小没有限制,但是区分大小写的条目不得超过32K


Option Explicit

Dim oFS : Set oFS=CreateObject( "Scripting.FileSystemObject" )
Dim oWS : Set oWS=CreateObject( "WScript.Shell" )

WScript.Echo "Script:"
WScript.Echo "ScriptFullName:", WScript.ScriptFullName
WScript.Echo "ScriptFullPath:", oFS.GetParentFolderName( WScript.ScriptFullName )
WScript.Echo "Current:"
WScript.Echo "FS:", oFS.GetAbsolutePathName( "." )
WScript.Echo "WS:", oWS.CurrentDirectory

-------- output -------------

C:\wis\_vbs\0506\dev\forum
cscript curdir.vbs
Script:
ScriptFullName: C:\wis\_vbs\0506\dev\forum\curdir.vbs
ScriptFullPath: C:\wis\_vbs\0506\dev\forum
Current:
FS: C:\wis\_vbs\0506\dev\forum
WS: C:\wis\_vbs\0506\dev\forum

C:\wis\_vbs\0506\dev\forum
cd ..

C:\wis\_vbs\0506\dev
cscript forum\curdir.vbs
Script:
ScriptFullName: C:\wis\_vbs\0506\dev\forum\curdir.vbs
ScriptFullPath: C:\wis\_vbs\0506\dev\forum
Current:
FS: C:\wis\_vbs\0506\dev
WS: C:\wis\_vbs\0506\dev


  类同样可以定义自己的事件,它和方法的程序编写格式类似,只不过需要WithEvents关键字进行参数声明,而且事件不能有任何命名参数或者可选参数,它也没有返回值

Wscript.EchoobjRecordset.Fields.Item(0).Value
开被检测

二、利用adodc(ADODataControl)进行数据库链接:
privateform_load()
DimstrAsString'定义
str=App.Path
IfRight(str,1)<>""Then
str=str ""
EndIf
str="Provider=Microsoft.Jet.OLEDB.3.51;PersistSecurityInfo=False;DataSource="&str&"\tsl.mdb"
Adodc1.ConnectionString=str
Adodc1.CommandType=adCmdText
Adodc1.RecordSource="select*fromtable3"
Adodc1.Refresh
endsub

三、利用DataEnvironment进行数据库链接
可在过程中放入:
OnErrorResumeNext
IfDataEnvironment1.rsCommand1.State<>adStateClosedThen
DataEnvironment1.rsCommand1.Close'如果打开,则关闭
EndIf
'i=InputBox("请输入友人编号:","输入")
'Ifi=""ThenExitSub
DataEnvironment1.Connection1.OpenApp.Path&"?atabase\tsl.mdb"
DataEnvironment1.rsCommand1.Open"select*fromtable3where编号='"&i&"'"
'SetDataReport2.DataSource=DataEnvironment1
'DataReport2.DataMember="command1"
'DataReport2.show
endsub

四、利用ADO(ActiveXDataObjects)进行编程:
建立连接:
dimconnasnewadodb.connection
dimrsasnewadodb.recordset
dimstr
str=App.Path
IfRight(str,1)<>""Then
str=str ""
EndIf
str="Provider=Microsoft.Jet.OLEDB.3.51;PersistSecurityInfo=False;DataSource="&str&"\tsl.mdb"
conn.openstr
rs.cursorlocation=aduseclient
rs.open"数据表名",conn,adopenkeyset.adlockpessimistic
用完之后关闭数据库:
conn.close
setconn=nothing->


'''注册表查询/操作
On Error Resume Next
Const HKEY_CLASSES_ROOT=&H80000000'''设置注册表5大根键,HKCR-----------①
Const HKEY_CURRENT_USER=&H80000001'''HKCU
Const HKEY_LOCAL_MACHINE=&H80000002'''HKLM
Const HKEY_Users=&H80000003'''HKU
Const HKEY_Current_Config=&H80000005'''HKCC
Const REG_SZ=1'''设置注册表键值类型,字符串型---------------------------②
Const REG_EXPAND_SZ=2'''扩展字符串型
Const REG_BINARY=3'''二进制型
Const REG_DWORD=4'''双字节型
Const REG_MULTI_SZ=7'''多字符串型
Const KEY_QUERY_VALUE=&H0001'''查询注册表权限,查询数值-----------------③
Const KEY_SET_VALUE=&H0002'''设置数值
Const KEY_CREATE_SUB_KEY=&H0004'''创建子项
Const DELETE=&H00010000'''删除项值
'''-----------------配置环境(路径)----------------------------------------00
strComputer="."
Set WshShell=WScript.CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv")
strKeyRoot=HKEY_LOCAL_MACHINE
Regpath="HKEY_LOCAL_MACHINE"
strKeyPath="Software\Microsoft\Windows\CurrentVersion\Run"
WshSHell.popup "设置路径【HKLM\Software\Microsoft\Windows\CurrentVersion\Run】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建主键"REG_KEY_SZ"----------------------------------01
strKeyPathNew="Software\Microsoft\Windows\CurrentVersion\Run\User_baomaboy"'''注意因为是新建主键,要多加个“\”
oReg.CreateKey strKeyRoot, strKeyPathNew
WshSHell.popup "创建主键【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\User_baomaboy\】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建字符串值"REG_SZ"----------------------------------02
strValueName="1字符串名"
strValue="字符串值"
oReg.SetStringValue strKeyRoot, strKeyPath, strValueName, strValue
WshSHell.popup "创建字符串【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\1字符串名】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建双字节值"REG_DWORD"--------------------------------
strValueName="2双字节名"
strValue=1
oReg.SetDWORDValue strKeyRoot, strKeyPath, strValueName, strValue
WshSHell.popup "创建双字节值【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\2双字节名】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建多字符串"REG_MULTI_SZ"-----------------------------
strValueName="3多字符串名"
arrStringValues=Array("QQ25926183", "userbaomaboy","LLKJ", "玲珑科技")
oReg.SetMultiStringValue strKeyRoot, strKeyPath, strValueName, arrStringValues
WshSHell.popup "创建多字符串【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\3多字符串名】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建扩展字符串"REG_EXPAND_SZ"--------------------------
strValueName="4扩展字符串名"
strValue="%PATHEXT%"
oReg.SetExpandedStringValue strKeyRoot, strKeyPath, strValueName, strValue
WshSHell.popup "创建扩展字符串【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\4扩展字符串名】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------创建二进制值"REG_BINVRY_SZ"----------------------------
RegPathEr=Regpath&"\Software\Microsoft\Windows\CurrentVersion\Run\5二进制值"
WshSHell.RegWrite RegPathEr,1,"REG_BINARY"
WshSHell.popup "创建二进制值【HKLM\Software\Microsoft\Windows\CurrentVersion\Run\5二进制值】成功"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 读取字符串值"REG_VALUE"-------------------------------
oReg.GetStringValue strKeyRoot, strKeyPath, "1字符串名", strRunCommand
WshSHell.popup "读取字符串值:"&vbcrlf&vbcrlf&strRunCommand&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 读取双字节值"REG_DWORD"-------------------------------
oReg.GetDWORDValue strKeyRoot, strKeyPath, "2双字节名", strRunCommand
WshSHell.popup "读取双字节值:"&vbcrlf&vbcrlf&strRunCommand&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 读取多字符串值"REG_MULTI_SZ"--------------------------
oReg.GetMultiStringValue strKeyRoot, strKeyPath, "3多字符串名", arrValues
For Each strValue In arrValues
DuoString=DuoString&vbcrlf&strValue
Next
WshSHell.popup "读取多字符串值:"&vbcrlf&vbcrlf&DuoString&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 读取扩展字符串"REG_EXPAND_SZ"-------------------------
oReg.GetExpandedStringValue strKeyRoot, strKeyPath, "4扩展字符串名", strValue
WshSHell.popup "读取扩展字符串值:"&vbcrlf&vbcrlf&strValue&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 读取二进制值"REG_BINVRY_SZ"----------------------------
oReg.GetBinaryValue strKeyRoot, strKeyPath, "5二进制值", strValue
For i=lBound(strValue) to uBound(strValue)
ErString=ErString&strValue(i)
Next
WshSHell.popup "读取二进制值:"&vbcrlf&vbcrlf&ErString&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 枚举主键"SUB_KEY"--------------------------------------
oReg.EnumKey strKeyRoot, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
ArrSubKeyStr=ArrSubKeyStr&vbcrlf&subkey
Next
WshSHell.popup "枚举主键:"&vbcrlf&vbcrlf&ArrSubKeyStr&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 枚举键值和键值类型"KEY_Value_Types"--------------------
oReg.EnumValues strKeyRoot, strKeyPath, arrValueNames, arrValueTypes
For i=0 To UBound(arrValueNames)
If Len(arrValueNames(i)) > 0 Then
Select Case arrValueTypes(i)
Case REG_SZ ValueType=" >>>是:字符串值"
Case REG_EXPAND_SZ ValueType=" >>>是:扩展字符串值"
Case REG_BINARY ValueType=" >>>是:二进制值"
Case REG_DWORD ValueType=" >>>是:双字节值"
Case REG_MULTI_SZ ValueType=" >>>是:多字符串值"
End Select
arrValueStr=arrValueStr&vbcrlf&arrValueNames(i)&ValueType
End If
Next
WshSHell.popup "枚举键值和类型:"&vbcrlf&vbcrlf&arrValueStr&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 枚举键值和键值内容一"KEY_Value_Contenct"----------------
oReg.EnumValues strKeyRoot, strKeyPath, arrValueNames, arrValueTypes
For i=0 To UBound(arrValueNames)
If Len(arrValueNames(i)) > 0 Then
oReg.GetStringValue strKeyRoot,strKeyPath,arrValueNames(i),strValue'''适应于字符串型
ValueStr=ValueStr&vbcrlf&arrValueNames(i)&vbcrlf&strValue
end if
Next
WshSHell.popup "枚举键值和内容一:"&vbcrlf&vbcrlf&ValueStr&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 枚举键值和键值内容二"KEY_Value_Contenct"----------------
oReg.EnumValues strKeyRoot, strKeyPath, arrValueNames, arrValueTypes
i=0
For Each strValue in arrValueNames
If Len(strValue) > 0 Then
i=i+1
oReg.GetStringValue strKeyRoot,strKeyPath,strValue,strRunCommand'''适应于字符串型
intLength=Len(strRunCommand)
if intLength > 35 then'''美化回显,(可再加代码判路径是否包含断汉字)
strRunCommand=Left(strRunCommand, 20)&"……"&Right(strRunCommand, 13)
end if
StrRoot=i&".【"&strValue&"】"&vbCRLF&" "&strRunCommand
ARoot=ARoot&vbCRLF&StrRoot
End If
Next
WshSHell.popup "枚举键值和内容二:"&vbcrlf&vbcrlf&ARoot&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 删除键值"REG_VALUE"-------------------------------------
oReg.DeleteValue strKeyRoot, strKeyPath, "5二进制值"
WshSHell.popup "删除键值:"&vbcrlf&vbcrlf&Regpath&""&strKeyPath&"\5二进制值"&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''----------------- 删除主键"SUB_KEY"---------------------------------------
oReg.DeleteKey strKeyRoot, strKeyPathNew
WshSHell.popup "删除主键:"&vbcrlf&vbcrlf&Regpath&""&strKeyPathNew&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----------------判断键值是否存在-----------------------------------------
strValue="""病毒"""
oReg.GetStringValue strKeyRoot,strKeyPath,strValue,strRunCommand
If IsNull(strRunCommand) Then
WshSHell.popup strValue&"此注册表键值不存在."&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
Else
WshSHell.popup strValue&"注册表中存在此键值."&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
End If
'''----------------- 检查注册表访问权限"Check Up Extent Of Power"------------
oReg.CheckAccess strKeyRoot, strKeyPath, KEY_QUERY_VALUE, bHasAccessRight
If bHasAccessRight=True Then
aaa="可以查询数值"
Else
aaa="不可查询数值"
End If
oReg.CheckAccess strKeyRoot, strKeyPath, KEY_SET_VALUE, bHasAccessRight
If bHasAccessRight=True Then
bbb="可以设置数值"
Else
bbb="不可设置数值"
End If
oReg.CheckAccess strKeyRoot, strKeyPath, KEY_CREATE_SUB_KEY, bHasAccessRight
If bHasAccessRight=True Then
ccc="可以创建主键"
Else
ccc="不可创建主键"
End If
oReg.CheckAccess strKeyRoot, strKeyPath, DELETE, bHasAccessRight
If bHasAccessRight=True Then
ddd="可以删除键值"
Else
ddd="不可删除键值"
End If
WshSHell.popup "注册表访问权限:"&vbcrlf&vbcrlf&Regpath&""&strKeyPath&vbcrlf&vbcrlf&aaa&vbcrlf&bbb&vbcrlf&ccc&vbcrlf&ddd&vbcrlf&vbcrlf&vbcrlf&vbcrlf&vbcrlf&"5 秒钟后本窗口将自动关闭!", 5, "QQ:25926183", 0 + 64
'''-----恢复注册表原样--------
oReg.DeleteValue strKeyRoot, strKeyPath, "4扩展字符串名"
oReg.DeleteValue strKeyRoot, strKeyPath, "3多字符串名"
oReg.DeleteValue strKeyRoot, strKeyPath, "2双字节名"
oReg.DeleteValue strKeyRoot, strKeyPath, "1字符串名"
'''-----------------监视注册表键值"REG_KEY_SZ"-------------------------------
'''用以对注册表中HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\1字符串名"分支下的所有更改内容进行监视。

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