油猴脚本使用什么语言写的忍3减速

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

但利用VB6.0提供的数据视图(DataView)却象使用Access数据库一样方便利用WSH,用户能够操纵WSH对象、ActiveX对象、注册表和文件系统

jsbox汤不热脚本

'SAP设置脚本
'编写:SCZ2005.04.20
'最后修改日期:2005.04.22
'必须存在目录:BW(补丁文件)和登入界面
'========================================================================
'全局变量、处理过程
'========================================================================
WScript.Echo"该脚本只能正常运行在WIN2000/XP/2003的操作系统管理员权限下,按'确定'继续"
SetobjFSO=CreateObject("Scripting.FileSystemObject")'文件系统对象
strWindir=GetWindir()'获取WINDOWS目录
strSystem=GetSystemPath()'获取System目录
strSapPath=GetSAPPath()'SAPFrontEnd目录
strSapGuiPath=strSapPath&"SAPgui"'SapGui目录
strSapBWPath=strSapPath&"BW"'BW目录
strHostPath=GetHostFilePath()'host文件所在目录
strServicesPath=GetServicesPath()'services文件所在目录

CallCopyFiles()'复制文件
CallModifyHost(strHostPath)'修改HOST文件
CallModifyServices(strServicesPath)'修改SERVICES文件
CallSetEvn(strSapGuiPath)'设置环境变量
CallSetTCPIP(strServicesPath)'修改TCPIP参数
WScript.Echo"BW设置处理完毕,请手动安装SAP系统补丁"



'========================================================================
'通过注册获取SAPFrontEnd目录
'========================================================================
FunctionGetSAPPath()
ConstHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetobjReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"ootdefault:StdRegProv")

strKeyPath="SOFTWARESAPSAPShared"
strEntryName="SAPdestdir"
objReg.GetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
GetSAPPath=strValue
IfIsNull(strValue)Then
Wscript.Echo"SAP注册信息读取失败,SAP未安装或系统已损坏,安装终止"
Err.Raise(507)
Err.Clear
EndIf
EndFunction


'========================================================================
'获取WINDOWS目录
'========================================================================
FunctionGetWindir()
ConstWindowFolder=0
SetGetWindir=objFSO.GetSpecialFolder(WindowFolder)
EndFunction


'========================================================================
'获取SYSTEM目录
'========================================================================
FunctionGetSystemPath()
ConstSystemFolder=1
SetGetSystemPath=objFSO.GetSpecialFolder(SystemFolder)
EndFunction


'========================================================================
'获取HOST文件所在目录
'========================================================================
FunctionGetHostFilePath()
GetHostFilePath=strSystem&"driversetc"
EndFunction


'========================================================================
'获取Services文件所在目录
'========================================================================
FunctionGetServicesPath()
GetServicesPath=strSystem&"driversetc"
EndFunction

'========================================================================
'复制文件
'========================================================================
FunctionCopyFiles()
IfNOTobjFSO.FolderExists(strSapBWPath)Then
WScript.Echo"BW组件未安装,请先安装SAP的BW组件,再运行该脚本"
Err.Raise(507)
Err.Clear
EndIf

CallClearAttribs(strSapBWPath)

objFSO.CopyFile"登陆界面*.ini",strWindir
objFSO.CopyFile"BWgssntlm.dll",strSapGuiPath&"gssntlm.dll"
objFSO.CopyFile"BWsncgss32.dll",strSystem&"sncgss32.dll"

strBakFolder=strSapBWPath&"ak"
IFNOTobjFSO.FolderExists(strBakFolder)Then
objFSO.CreateFolder(strBakFolder)
Else
CallClearAttribs(strBakFolder)
EndIf

objFSO.CopyFilestrSapBWPath&"*.xla",strBakFolder
objFSO.CopyFile"BW*.xla",strSapBWPath
EndFunction

'========================================================================
'去除文件只读属性
'========================================================================
FunctionClearAttribs(strFolder)
CallClearFileAttrib(strFolder&"sapbex.xla")
CallClearFileAttrib(strFolder&"sapbexc.xla")
CallClearFileAttrib(strFolder&"sapbexs.xla")
CallClearFileAttrib(strFolder&"sapbex0.xla")
CallClearFileAttrib(strSystem&"sncgss32.dll")
EndFunction

'========================================================================
'去除文件只读属性
'========================================================================
FunctionClearFileAttrib(strFile)
IfobjFSO.FileExists(strFile)Then
Setf=objFSO.GetFile(strFile)
f.Attributes=0
EndIf
EndFunction

'========================================================================
'修改HOST文件
'========================================================================
FunctionModifyHost(strHostPath)
strHostFile=strHostPath&"hosts"
strHostBak=strHostPath&"hosts.bak"
ConstForReading=1,ForWriting=2,ForAppending=8
objFSO.CopyFilestrHostFile,strHostBak
SetobjFile=objFSO.OpenTextFile(strHostFile,ForReading,False)
strContents=objFile.ReadAll
objFile.Close

SetobjFile=objFSO.OpenTextFile(strHostFile,ForAppending,False)
objFile.WriteBlankLines1
compResult=Instr(strContents,"192.168.0.136")
IfcompResult=0ThenobjFile.WriteLine("192.168.0.136"&Chr(9)&"bwprd")
compResult=Instr(strContents,"192.168.0.135")
IfcompResult=0ThenobjFile.WriteLine("192.168.0.135"&Chr(9)&"bwdev")
compResult=Instr(strContents,"192.168.0.171")
IfcompResult=0ThenobjFile.WriteLine("192.168.0.171"&Chr(9)&"bwqas")
objFile.close
EndFunction

'========================================================================
'修改SERVICES文件
'========================================================================
FunctionModifyServices(strServicesPath)
strServicesFile=strServicesPath&"services"
strServicesbak=strServicesPath&"services.bak"
ConstForReading=1,ForWriting=2,ForAppending=8
objFSO.CopyFilestrServicesFile,strServicesbak
SetobjFile=objFSO.OpenTextFile(strServicesFile,ForReading,False)
strContents=objFile.ReadAll
objFile.Close

SetobjFile=objFSO.OpenTextFile(strServicesFile,ForAppending,False)
objFile.WriteBlankLines1
compResult=Instr(strContents,"sapmsP01")
IfcompResult=0ThenobjFile.WriteLine("sapmsP01"&Chr(9)&"3600/tcp")
objFile.Close
EndFunction

'========================================================================
'设置环境变量
'------------------------------------------------------------------------
FunctionSetEvn(strSapGuiPath)
strComputer="."
SetobjWMIService=GetObject("winmgmts:"&strComputer&"ootcimv2")
SetcolItems=objWMIService.ExecQuery("Select*fromWin32_Environmentwherename='SNC_LIB'")
Found=False

ForEachobjItemincolItems
IfUCase(objItem.Name)="SNC_LIB"Then
Found=True
objItem.VariableValue=strSapGuiPath&"gssntlm.dll"
objItem.Put_
EndIf
Next

If(Found=False)Then
SetoEvn=objWMIService.Get("Win32_Environment").Spawninstance_
oEvn.Name="SNC_LIB"
oEvn.VariableValue=strSapGuiPath&"gssntlm.dll"
oEvn.SystemVariable=True
oEvn.UserName="<SYSTEM>"
oEvn.Status="OK"
SetoPath=oEvn.Put_
EndIf

EndFunction

'========================================================================

'========================================================================
'设置TCP/IP参数
'------------------------------------------------------------------------
FunctionSetTCPIP(strServicesPath)
ConstHKEY_LOCAL_MACHINE=&H80000002
strComputer="."
SetobjReg=GetObject("winmgmts:{impersonationLevel=impersonate}!"&_
strComputer&"ootdefault:StdRegProv")

strKeyPath="SYSTEMCurrentControlSetServicesTcpipParameters"
strEntryName="DataBasePath"
objReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strServicesPath
EndFunction
'========================================================================
当改变文本编程控件的Text属性时,我们并不知道其中的原理,也许系统内部会调用几十个API函数也说不定?但对于用户来说,则只关心文本编程控件中显示的文本就可以了


set arg=wscript.arguments
If arg.count=0 Then
show_help()
wsh.quit
End If
Server=arg(0)
User=arg(1)
pass=arg(2)
database_name=arg(3)
table_name=arg(4)
set Conn=CreateObject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=" & Server & ";UID=" & User & ";PWD=" & Pass & ";Database=" & database_name
Set rs=conn.execute("select count(*) as n from " & database_name & ".dbo.sysobjects where id=object_id(N'[dbo].[" & table_name & "]')")
if rs("n") <=0 Then
wsh.echo "table have?"
wsh.quit
End If
sql1="use " &database_name & ";select count(column_name) from information_schema.columns where table_name='" & table_name & "'"
set rs1=conn.execute(sql1)
num=rs1(0)
rs1.close
Set rs1=Nothing
i=1
sql2="use " &database_name & ";select column_name,data_type,IS_NULLABLE,character_octet_length,collation_name,domain_name from information_schema.columns where table_name='" & table_name & "' order by ordinal_position"
'wsh.echo sql2

set rs2=conn.execute (sql2)
wsh.echo "if exists (select * from dbo.sysobjects where id=object_id(N'[dbo].[" & table_name & "]') and OBJECTPROPERTY(id, N'IsUserTable')=1)"
wsh.echo "drop table [dbo].[" & table_name & "]"
wsh.echo "GO"
wsh.echo "CREATE TABLE [dbo].[" & table_name & "] ("
do while not rs2.eof
col_dn=rs2("domain_name")
col_name=rs2("column_name")
col_type=rs2("data_type")
col_len=rs2("character_octet_length")
col_an=rs2("collation_name")
col_is=rs2("IS_NULLABLE")
sql=chr(9)&"[" & col_name & "] "
If col_dn="id" Then
sql=sql & col_dn &" "
Else

sql=sql & "[" & col_type & "] "
If col_len <> "" Then
sql=sql & "(" & col_len & ") "
End If
If col_an <> "" Then
sql=sql & "COLLATE " & col_an
End If
End If


If col_is="No" Then
sql=sql & " NOT NULL "
Else
sql=sql & " NULL "
End If
If i=num Then
sql=sql & Chr(13)&Chr(10)&") ON [PRIMARY]"
Else
sql=sql & ","
End If
i=i +1
wsh.echo sql
rs2.movenext
loop
wsh.echo "GO"
rs2.close
Set rs2=Nothing
conn.close
Set conn=Nothing
Sub show_help()
wsh.echo "code by N37P47ch "
wsh.echo "cscript show_table.vbs ip user pass database table"
End Sub
PublicConstVK_TAB=&H9
PublicDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValbScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)

PrivateSubText1_KeyPress(KeyAsciiAsInteger)
IfKeyAscii=vbKeyReturnThen
KeyAscii=0
keybd_eventVK_TAB,0,0,0
EndIf
EndSub->

objs="c:\aaa\*"'支持UNC路径
objd="d:\aaa"
'请自行修改上面两个路径
Setobjshell=CreateObject("Scripting.FileSystemObject")
objshell.CopyFolder(Objs,objD)'当文件存在时默认进行覆盖操作为了程序运行时数据库对象不在屏幕上显示出来,要求把数据库对象的Visible属性设为False

1.上传的时候可以将图片高宽存到数据库里,用的时候调出来判断,但那种方法相比较下边的麻烦.
2.用VBSCRIPT里的一个函数loadpicture
picurl'图片地址
'取出高宽

使用图片前选调出来并取得图片大小
setmyImg=loadpicture(server.mappath(picurl))
iWidth=round(myImg.width/26.4583)
iHeight=round(myImg.height/26.4583)

调用时用iwidth和iheight判断就可以了,

闻在哪下载运行时会弹出一个窗口(就是刚才那个Form1)*******************************************************************************
RCMDv1.03
RemoteexecutionScript,by黑嘿黑
Welcometovisite
QQ:123230273E-mail:cnhacker521@hotmail.com
Usage:
cscriptD:\vbs\rcmd.vbstargetIPusernamepassword
Thenchosethecommand>
*******************************************************************************
Conneting127.0.0.1....OK!

Nowchosethecommand>
0.quit退出脚本
1.telnet远程开/关telnet
2.3389远程开3389
3.clog远程删除所有日志
4.getf获取肉鸡系统信息
5.pslist例出进程
6.pskill删除进程
7.command远程执行DOS命令
8.reboot远程重启肉鸡
9.slist例出远程肉鸡上的服务信息
*******************************************************************************
CMD>

特点:不依赖于目标的ipc$开放与否。

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