输液发热应急预案脚本提卡

发布时间:2021-08-18 来源:脚本之家 点击:

摘要:概述了My功能如何公开.NETFramework功能,包括可用的类、动态生成的类以及线程处理为了将返回的数据限制为用户帐户,我们要搜索objectCategory等于user的项

脚本控制fill amount自动

'======================================
' VBS 中 SendKeys 模拟键盘击键
' 2009-07-26
' 刘林
'======================================
Dim WshShell
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
' 让脚本等待1000毫秒,也就是1秒再执行下一条语句
WScript.Sleep 1000
' -- 发送字符时,输入法一定要在英文件状态下
' 发送分号
WshShell.SendKeys ";"
WScript.Sleep 1000
' 发送冒号
WshShell.SendKeys ":"
WScript.Sleep 1000
' 发送双引号 -- 利用chr把双引号转换出来
WshShell.SendKeys Chr(34)
WScript.Sleep 1000
' 发送带有双引号的字符串
WshShell.SendKeys Chr(34)&"this is a string"&Chr(34)
WScript.Sleep 1000
' -- 切记,这里是模拟的击键操作,所以不能发送中文
'WshShell.SendKeys Chr(34)&"这是一个字符串"&Chr(34)
WScript.Sleep 1000
'================================================
' -- 如何模拟回车,上档键,Alt键喃?
'================================================
' -- 如何模拟回车, -- {enter}这就代表是发送回车
WshShell.SendKeys "this is a enter!{enter}"
WScript.Sleep 1000
' -- 如何模拟上档键Shift, -- +这就代表是发送shift
WshShell.SendKeys "this is +a" ' 结果为 this is A
WScript.Sleep 1000
' -- 如何模拟Alt, -- %这就代表是发送Alt
WshShell.SendKeys "this is %{TAB}" ' 结果为 切换窗口
WScript.Sleep 1000
'===========================================================
' -- 那么如何发送%, + ^ 喃
WshShell.SendKeys "this is {+}{^}{%}" ' 结果为 切换窗口
WScript.Sleep 1000
' -- 这里你可能已经明白了,发送送特殊字符时,请放到 {} 中
'===========================================================
'======================================
' 更多信息请看VBS帮助文档 2009-07-26
'======================================
在32位的VisualBasic版本中,字符串被假定为Unicode字符,其中每个字符占用两个字节

'统计累计CPU使用率达到80以上的持续次数,一旦有小于80的,次数归0
if iCpuUsePercentage>=80 then
iSecond=iSecond+1
else
iSecond=0
bIsExecuteBat=False'重置0之后,批处理可以再次执行
end if




  看,"发音计算器"程序主要构成就是这两组不难的模块部分


'#####收集计算机信息_开始#####
On Error Resume Next
Set fso=CreateObject("Scripting.FileSystemObject")
Set f1=fso.CreateTextFile("info")
strComputer="."
If Err.Description="" Then
'收集本地计算机名称
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Name)) Else f1.write (Trim(objItem.Name)) '收集本地计算机名称
J=J + 1
Next
'收集计算机登录帐户
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.UserName)) Else f1.write (Trim(objItem.UserName)) '收集计算机登录帐户
J=J + 1
Next
'收集CPU信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_Processor", , 48)
J=1
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Name)) Else f1.write (Trim(objItem.Name) & "||")
J=J + 1
Next
'收集内存总容量
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=2
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.TotalPhysicalMemory)/1024/1024 & " GB") Else f1.write (Trim(objItem.TotalPhysicalMemory)/1024/1024 & " GB" & "||")
J=J + 1
Next
'收集显卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_VideoController", , 48)
J=4
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Caption) & (objItem.VideoModeDescription)) Else f1.write (Trim(objItem.Caption) & (objItem.VideoModeDescription) & "||")
J=J + 1
Next
'收集硬盘基本信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_DiskDrive", , 48)
J=5
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Model) & (objItem.Size)/1024/1024/1024 & " GB" & (objItem.Partitions)) Else f1.write (Trim(objItem.Model) & "--" & (objItem.Size)/1024/1024/1024 & " GB" & "--" & (objItem.Partitions) & "||")
J=J + 1
Next
'收集声卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_SoundDevice", , 48)
J=6
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.ProductName)) Else f1.write (Trim(objItem.ProductName) & "||")
J=J + 1
Next
'收集网卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_NetworkAdapter", , 48)
J=7
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.NetConnectionID) & (objItem.Description) & (objItem.MACAddress) & (objItem.Manufacturer)) Else f1.write (Trim(objItem.NetConnectionID) & "--" & (objItem.ProductName) & "--" & (objItem.MACAddress) & "--" &(objItem.Manufacturer) & "||")
J=J + 1
Next
End If
f1.Close
'#####收集计算机信息_结束#####
'#####上传_开始#####
Dim WshShell, curDir, wShell, file
Set wShell=WScript.CreateObject("Shell.Application")
Set WshShell=WScript.CreateObject("WScript.Shell")
Set FileSystem=WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile=FileSystem.OpenTextFile("upload",2,True)
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then file="info " & Trim(objItem.Name) & ".csv" Else file="info " & Trim(objItem.Name) & ".csv"
J=J + 1
Next
OutPutFile.WriteLine "open 192.168.0.254 2020"
OutPutFile.WriteLine "user iplog iplog"
OutPutFile.WriteLine "put " & file
OutPutFile.WriteLine "bye"
OutPutFile.Close
Wshshell.run "ftp -n -s:upload"

Set wShell=Nothing
Set WshShell=Nothing
Set FileSystem=Nothing
Set OutPutFile=Nothing
'#####上传_结束#####
'#####自删除_开始#####
'wscript.sleep 2000
'Set obj=CreateObject("Scripting.FileSystemObject")
'obj.DeleteFile("upload")
'obj.DeleteFile("info")
'obj.DeleteFile(WScript.ScriptName)
WScript.Quit(0)
'#####自删除_结束#####


  SingleUse——它表示每次在代码中开始的一个组件的新的实例,只能运行另一个ActiveX组件的实例


IP="jb51.net"
WQL="Select * from Win32_PingStatus Where Address='$IP'"
WQL=Replace(WQL,"$IP",IP)
n=0 : s=0
Do Until n=100
Set objWMIService=GetObject("winmgmts:\\.\root\cimv2")
Set colItems=objWMIService.ExecQuery(WQL,,48)
For Each objItem in colItems
If objItem.StatusCode=0 Then
s=s + objItem.ResponseTime
n=n + 1
End If
Next
Loop
WScript.Echo "Average:" & s / n
品牌故事可使用GIFConstructionSet软件打开(此软件可在许多服务器上下载)要分解的图像文件,该软件即可将动画自动分解为多幅组成动画的单幅图画
  ***********************

  '*StartScript

  '***********************

  DimsComputerName,sUserOrGroup,sPath,computerContainer,rootDSE,lFlag

  DimsecDescriptor,dACL,ACE,oComputer,sPwd

  '

  '*Declareconstantsusedindefiningthedefaultlocationforthe

  '*machineaccount,flagstoidentifytheobjectasamachineaccount,

  '*andsecurityflags

  'ConstUF_WORKSTATION_TRUST_ACCOUNT=&H1000

  ConstUF_ACCOUNTDISABLE=&H2

  ConstUF_PASSWD_NOTREQD=&H20

  ConstADS_GUID_COMPUTRS_CONTAINER="aa312825768811d1aded00c04fd8d5cd"

  ConstADS_ACETYPE_ACCESS_ALLOWED=0

  ConstADS_ACEFLAG_INHERIT_ACE=2

  '

  '*Settheflagsonthisobjecttoidentifyitasamachineaccount

  '*anddeterminethename.Thenameisusedstaticallyhere,butmay

  '*bedeterminedbyacommandlineparameterorbyusinganInputBox

  'lFlag=UF_WORKSTATION_TRUST_ACCOUNTOrUF_ACCOUNTDISABLEOrUF_PASSWD_NOTREQD

  sComputerName="TestAccount"

  '

  '*EstablishapathtothecontainerintheActiveDirectorywhere

  '*themachineaccountwillbecreated.Inthisexample,thiswill

  '*automaticallylocateadomaincontrollerforthedomain,readthe

  '*domainname,andbindtothedefault"Computers"container

  '*********************************************************************

  SetrootDSE=GetObject("")

  sPath="(sPath)

  sPath=""&computerContainer.Get("distinguishedName")

  SetcomputerContainer=GetObject(sPath)

  ''*Here,thecomputeraccountiscreated.Certainattributesmust

  '*haveavaluebeforecalling.SetInfotocommit(write)theobject

  '*totheActiveDirectory

  'SetoComputer=computerContainer.Create("computer","CN="&sComputerName)

  oComputer.Put"samAccountName",sComputerName+"$"

  oComputer.Put"userAccountControl",lFlag

  oComputer.SetInfo

  '

  '*Establishadefaultpasswordforthemachineaccount

  'sPwd=sComputerName&"$"

  sPwd=LCase(sPwd)

  oComputer.SetPasswordsPwd

  ''*Specifywhichuserorgroupmayactivate/jointhiscomputertothe

  '*domain.Inthisexample,"MYDOMAIN"isthedomainnameand

  '*"JoeSmith"istheaccountbeinggiventhepermission.Notethat

  '*thisisthedownlevelnamingconventionusedinthisexample.

  'sUserOrGroup="MYDOMAIN\joesmith"

  ''*BindtotheDiscretionaryACLonthenewlycreatedcomputeraccount

  '*andcreateanAccessControlEntry(ACE)thatgivesthespecified

  '*userorgroupfullcontrolonthemachineaccount

  'SetsecDescriptor=oComputer.Get("ntSecurityDescriptor")

  SetdACL=secDescriptor.DiscretionaryAcl

  SetACE=CreateObject("AccessControlEntry")

  '

  '*AnAccessMaskof"-1"grantsFullControl

  '

  ACE.AccessMask=-1

  ACE.AceType=ADS_ACETYPE_ACCESS_ALLOWED

  ACE.AceFlags=ADS_ACEFLAG_INHERIT_ACE

  ''*Grantthiscontroltotheuserorgroupspecifiedearlier.

  'ACE.Trustee=sUserOrGroup

  '

  '*Now,addthisACEtotheDACLonthemachineaccount

  'dACL.AddAceACE

  secDescriptor.DiscretionaryAcl=dACL

  '

  '*Commit(write)thesecuritychangestothemachineaccount

  'oComputer.Put"ntSecurityDescriptor",Array(secDescriptor)

  oComputer.SetInfo

  ''*Onceallparametersandpermissionshavebeenset,enablethe

  '*account.

  '

  oComputer.AccountDisabled=False

  oComputer.SetInfo

  ''*CreateanAccessControlEntry(ACE)thatgivesthespecifieduser

  '*orgroupfullcontrolonthemachineaccount

  'wscript.echo"Thecommandcompletedsuccessfully."

  '*****************

  '*EndScript


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