触动精灵脚本开通联系剑三代练

当我们要移动控制项(Control)或表单(Form)时,很多人习惯这样写:

frmCustomer.Left=frmCustomer.Left 100frmCustomer.Top=frmCustomer.Top 50

但是若使用MoveMethod,可以加快40:

frmCustomer.MovefrmCustomer.Left 100,frmCustomer.Top 50->

),混放在正常的脚本之中,常常让我们防不胜防脚本编程多久学会Setwmi=GetObject("winmgmts:\") Setboard=wmi.instancesof("win32_baseboard") ForEachbInboard msg="主板:"&b.Manufacturer&vbTab&b.product&vbTab&Chr(13) Next msg=msg&Chr(13)&"---"+Chr(13) Setcpus=wmi.instancesof("win32_processor") msg=msg&"CPU特征:"+Chr(13) ForEachcpuIncpus msg=msg+cpu.deviceid&vbTab&cpu.name&Chr(13)_ &vbtab&cpu.SocketDesignation&vbtab&cpu.CurrentClockSpeed&"MHz"&vbtab&cpu.l2cachesize&"Kb_L2"&Chr(13) Next msg=msg&Chr(13)&"---"+Chr(13) Setmem=wmi.instancesof("win32_physicalmemory") msg=msg&"内存容量:"+Chr(13) ForEachmInmem msg=msg&m.tag&space(10)&m.capacity&+Chr(13) Next Setmem=wmi.instancesof("win32_computersystem") ForEachmInmem msg=msg&"内存总容量:"&Round((m.totalphysicalmemory/1024^2),2)&"M"+Chr(13) Next msg=msg&Chr(13)&"---"+Chr(13) Setdisplay=wmi.instancesof("Win32_videocontroller") msg=msg&"显示系统:"+Chr(13) ForEachvideoIndisplay msg=msg&video.deviceid&vbTab&video.name&Chr(13) Next msg=msg&Chr(13)&"---"+Chr(13) Setdisks=wmi.instancesof("win32_diskdrive") msg=msg&"硬盘容量:"+Chr(13) ForEachdIndisks Ifint(d.size/(1024^3))=0Then n=Round(d.size/(1024^2),2)&"M" Else n=Round(d.size/(1024^3),2)&"G" EndIf msg=msg+d.deviceid&"空间为:"&n&Chr(13) Next msg=msg&Chr(13)&"---"+Chr(13) MsgBoxmsg,0,"电脑基本特征" ->

OnErrorResumeNext 'codebyNetPatch Setarg=Wscript.Arguments '声明外部参数 IfArg.count=0thenWscript.quit '若没有参数则退出脚本 Num=0 SzBuf=InputBox("请输入要找的Ping时间值:","输入","200") '调用弹出消息输入框来获取要查找的时间 SetFso=CreateObject("Scripting.FileSystemObject") '声明FSO组件 SetGofile=Fso.OpenTextFile(Arg(0),1,False,-2) '打开拖进来的文件 DoWhileGofile.Atendofline<>True Ip=Gofile.Readline '读取一行 SetoShell=WScript.CreateObject("WScript.Shell") '声明WSH组件 SetoExec=oShell.Exec("ping-n1"&Ip&"") '执行PING命令,然后把结果附值到oExec SetFile=fso.OpenTextFile(arg(0)&".txt",8,True) DoWhileNotoExec.StdOut.AtEndOfStream strOut=oExec.StdOut.ReadLine() IfoExec.StdOut.line>4thenexitdo '用循环读取指定行数 Loop If Cint(GET_Time(StrOut))<Cint(SzBuf)Then File.WritelineIp&chr(9)&"Ping时间值为:"&GET_Time(StrOut)&"秒" '找到小于指定时间的机器,并写入新建立的文本 Num=Num+1 '找到后,记数(后面统计用) Endif Loop File.Close Gofile.Close SetFso=Nothing ifnum=0then wscript.echo"郁闷->

Option Explicit Const WBEM_MAX_WAIT=&H80 ' Registry Hives Const HKEY_LOCAL_MACHINE=&H80000002 Const HKEY_CURRENT_USER=&H80000001 Const HKEY_CLASSES_ROOT=&H80000000 Const HKEY_USERS=&H80000003 Const HKEY_CURRENT_CONFIG=&H80000005 Const HKEY_DYN_DATA=&H80000006 ' Reg Value Types Const REG_SZ=1 Const REG_EXPAND_SZ=2 Const REG_BINARY=3 Const REG_DWORD=4 Const REG_MULTI_SZ=7 ' Registry Permissions Const KEY_QUERY_VALUE=&H00001 Const KEY_SET_VALUE=&H00002 Const KEY_CREATE_SUB_KEY=&H00004 Const KEY_ENUMERATE_SUB_KEYS=&H00008 Const KEY_NOTIFY=&H00016 Const KEY_CREATE=&H00032 Const KEY_DELETE=&H10000 Const KEY_READ_CONTROL=&H20000 Const KEY_WRITE_DAC=&H40000 Const KEY_WRITE_OWNER=&H80000 Class std_registry Private Sub Class_Initialize() Set objRegistry=Nothing End Sub ' Connect to the reg provider for this registy object Public Function ConnectProvider32( sComputerName ) ConnectProvider32=False Set objRegistry=Nothing 'On Error Resume Next Dim oLoc : Set oLoc=CreateObject("Wbemscripting.SWbemLocator") Dim oCtx : Set oCtx=CreateObject("WbemScripting.SWbemNamedValueSet") ' Force 64 Bit Registry Call oCtx.Add("__ProviderArchitecture", 32 ) Call oCtx.Add("__RequiredArchitecture", True) Dim oSvc : Set oSvc=oLoc.ConnectServer(sComputerName,"root\default","","",,,WBEM_MAX_WAIT,oCtx) Set objRegistry=oSvc.Get("StdRegProv") If Err.Number=0 Then ConnectProvider32=True End If End Function ' Connect to the reg provider for this registy object Public Function ConnectProvider64( sComputerName ) ConnectProvider64=False Set objRegistry=Nothing On Error Resume Next Dim oLoc : Set oLoc=CreateObject("Wbemscripting.SWbemLocator") Dim oCtx : Set oCtx=CreateObject("WbemScripting.SWbemNamedValueSet") ' Force 64 Bit Registry Call oCtx.Add("__ProviderArchitecture", 64 ) Call oCtx.Add("__RequiredArchitecture", True) Dim oSvc : Set oSvc=oLoc.ConnectServer(sComputerName,"root\default","","",,,WBEM_MAX_WAIT,oCtx) Set objRegistry=oSvc.Get("StdRegProv") If Err.Number=0 Then ConnectProvider64=True End If End Function Public Function IsValid() IsValid=Eval( Not objRegistry Is Nothing ) End Function ' Used to read values from the registry, Returns 0 for success, all else is error ' ByRef data contains the registry value if the functions returns success ' The constants can be used for the sRootKey value: ' HKEY_LOCAL_MACHINE ' HKEY_CURRENT_USER ' HKEY_CLASSES_ROOT ' HKEY_USERS ' HKEY_CURRENT_CONFIG ' HKEY_DYN_DATA ' The constants can be used for the sType value: ' REG_SZ ' REG_MULTI_SZ ' REG_EXPAND_SZ ' REG_BINARY ' REG_DWORD Public Function ReadValue(ByVal hkRoot , ByVal nType , ByVal sKeyPath, ByVal sValueName , ByRef Data) On Error Resume Next ReadValue=-1 Dim bReturn, Results If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then 'Read Value Select Case nType Case REG_SZ ReadValue=objRegistry.GetStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_MULTI_SZ ReadValue=objRegistry.GetMultiStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_EXPAND_SZ ReadValue=objRegistry.GetExpandedStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_BINARY ReadValue=objRegistry.GetBinaryValue(hkRoot,sKeyPath,sValueName,Data) Case REG_DWORD ReadValue=objRegistry.GetDWORDValue(hkRoot,sKeyPath,sValueName,Data) End Select End If End Function ' Used to write registry values, returns 0 for success, all else is falure ' ' The constants can be used for the hkRoot value: ' HKEY_LOCAL_MACHINE ' HKEY_CURRENT_USER ' HKEY_CLASSES_ROOT ' HKEY_USERS ' HKEY_CURRENT_CONFIG ' HKEY_DYN_DATA ' The constants can be used for the nType value: ' REG_SZ ' REG_MULTI_SZ ' REG_EXPAND_SZ ' REG_BINARY ' REG_DWORD Function WriteValue( ByVal hkRoot , ByVal nType , ByVal sKeyPath, ByVal sValueName , ByVal Data) On Error Resume Next WriteValue=-1 'Default error If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then Call objRegistry.CreateKey( hkRoot , sKeyPath ) 'Create the key if not existing... 'Read Value Select Case nType Case REG_SZ WriteValue=objRegistry.SetStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_MULTI_SZ WriteValue=objRegistry.SetMultiStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_EXPAND_SZ WriteValue=objRegistry.SetExpandedStringValue(hkRoot,sKeyPath,sValueName,Data) Case REG_BINARY WriteValue=objRegistry.SetBinaryValue(hkRoot,sKeyPath,sValueName,Data) Case REG_DWORD WriteValue=objRegistry.SetDWORDValue(hkRoot,sKeyPath,sValueName,Data) End Select End If End Function Function DeleteValue( ByVal hkRoot , ByVal sKeyPath , ByVal sValueName ) On Error Resume Next DeleteValue=-1 'Default error If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then DeleteValue=objRegistry.DeleteValue( hkRoot , sKeyPath , sValueName ) End If End Function Public Function DeleteKey( hkRoot , ByVal sKeyPath ) DeleteKey=-1 On Error Resume Next If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then Dim arrSubKeys Dim sSubKey Call objRegistry.EnumKey( hkRoot, sKeyPath, arrSubkeys ) If IsArray(arrSubkeys) Then For Each sSubKey In arrSubkeys Call DeleteKey( hkRoot, sKeyPath & "" & sSubKey , bForce) Next End If DeleteKey=objRegistry.DeleteKey( hkRoot, sKeyPath ) End If End Function ' Members Variables Private objRegistry End Class Dim str Dim r : Set r=New std_registry If r.ConnectProvider32( "." ) Then If r.ReadValue( HKEY_LOCAL_MACHINE , REG_EXPAND_SZ , "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" , "ComSpec" , str )=0 Then Wsh.echo str Else Wsh.echo str End If End If 声明:PublicConstRIFF_ID=1179011410PublicConstRIFF_WAVE=1163280727PublicConstRIFF_FMT=544501094'TypicalheaderofasimpleRIFFWAVEfilePublicTypeWAVInfoRiff_FormatAsLongchunk_sizeAsLongChunkIDAsLongfmtAsLongWave_FormatAsIntegerChannelsAsInteger'0=单声道,1=立体声SamplesPerSecondAsLongAverageBytesPerSecondAsLong'11.025kHz,22.05kHz,等BlockAlignAsInteger'SizeofblocksforlowlevelplaybackEndType函数:PublicFunctionGetWaveInfo(ByvalfilenameAsString,ByrefwAsWAVInfo)_AsBooleanDimffAsIntegerff=FreeFileOnErrorGoToehandlerOpenfilenameForBinaryAccessReadAs#ffOnErrorGoToehandler_foGet#ff,,wClose#ffOnErrorGoToehandlerIfw.Riff_Format=RIFF_IDAndw.ChunkID=_RIFF_WAVEAndw.fmt=RIFF_FMTThenGetWaveInfo=TrueElseGetWaveInfo=FalseEndIfExitFunctionehandler_fo:Close#ffehandler:GetWaveInfo=FalseEndFunction->

文件操作 VBS 导入注册表,然后执行文件 PING内网 不通就 执行关机 的VBS 开机脚本VBS用于ARP邦定 运行程序 运行 oshell.run "d:\soft\hf\hfgame3\GameClient.lnk" 断开网络连接 启动网络连接 删除文件的VBS脚本 无界面自动检测安装iscsi客户端,映射及断开映射vbs脚本 下列代码实现无界面自动检测安装iscsi客户端,自动映射 下例代码实现无界面删除iscsi映射盘 删除QQ用户文件强制删除是不行的了,要跳过的话这样: 格5分钟运行一次批处理程序 要设开机自动运行,禁止程序

lua格式FunctionCompFile(F1asstring,F2asstring)asbooleanDimissameasbooleanOpenF1ForBinaryAs#1OpenF2ForBinaryAs#2issame=TrueIfLOF(1)<>LOF(2)Thenissame=FalseElsewhole&=LOF(1)\10000'numberofwhole10,000bytechunkspart&=LOF(1)Mod10000'remainingbytesatendoffilebuffer1$=String$(10000,0)buffer2$=String$(10000,0)start&=1Forx&=1Towhole&'thisfor-nextloopwillget10,000Get#1,start&,buffer1$'bytechunksatatime.Get#2,start&,buffer2$Ifbuffer1$<>buffer2$Thenissame=FalseExitForEndIfstart&=start& 10000Nextbuffer1$=String$(part&,0)buffer2$=String$(part&,0)Get#1,start&,buffer1$'gettheremainingbytesattheendGet#2,start&,buffer2$'gettheremainingbytesattheendIfbuffer1$<>buffer2$Thenissame=FalseEndIfCloseCompFile=issameEndFunction->14、使用官方加密工具 screnc.exe 我空间也有以前介绍 大家可能觉得我只是为了凑数才弄了这么多方法。
27人参与, 0条评论 登录后显示评论回复

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