五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

vbs查詢局域網(wǎng)內(nèi)電腦的軟件和硬件列表清單

發(fā)布日期:2021-12-23 15:40 | 文章來源:源碼中國

下面的代碼在windows下容易報(bào)毒大家可以放心使用

'==========================================================================
'
' Date:2009/3/19
' Name: 查詢軟件和硬件列表清單
' Author:Smileruner
' www.overmcse.com
' 不支持Win2000及WinNT
'
' 3/19,添加了網(wǎng)卡過濾。
'==========================================================================
'on error resume Next
const HKEY_LOCAL_MACHINE = &H80000002 
const UNINSTALL_ROOT = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
const REG_SZ = 1
'Set wshshell=wscript.createobject("wscript.shell")
' wshshell.run ("%comspec% /c regsvr32 /s scrrun.dll"),0,true
' wshshell.run ("%comspec% /c sc config winmgmt start= auto"),0,true
' wshshell.run ("%comspec% /c net start winmgmt"),0
strComputer = Inputbox("請輸入要查詢的計(jì)算機(jī)名稱",,"")
If strComputer = "" then
 Wscript.Echo "未輸入值或用戶取消,查詢退出。"
 Wscript.Quit
End If
Set objswbemlocator = createobject("wbemscripting.swbemlocator")
Set objswbemservices = objswbemlocator.connectserver(strComputer, "root\cimv2")
If Err.number <> 0 then
 Wscript.Echo "目標(biāo)計(jì)算機(jī)無法連接。錯誤的計(jì)算機(jī)名,或目標(biāo)計(jì)算機(jī)啟用了防火墻,RPC服務(wù)不可用。"
 Err.number.clear
 Wscript.Quit
End If
'swbemservices.security_.impersonationleobjvel = 3
Set fso=createobject("scripting.filesystemobject")
FileDate = Replace(date(), "/", "-")
resoultfilepath= strComputer & FileDate & ".html"
Set resultFile= fso.createtextfile(resoultfilepath,,true)
HtmlWriteHead()
'Html文檔開始
TableHead strComputer,"硬件清單"
'Html表格開始
OsWrite() 
'寫入操作系統(tǒng)信息
BoardWrite()
'寫入主板信息
CpuWrite() 
'寫入CPU信息
MemoryWrite() 
'寫入內(nèi)存信息
HarddiskWrite()
'寫入硬盤信息
CdromWrite()
'寫入CDROM信息
VideoWrite()
'寫入顯示卡信息
NetcardWrite()
'寫入網(wǎng)卡信息
TableEnd()
'Html表格結(jié)尾
TableHead strComputer,"軟件清單"
'Html表格開頭
Softlist()
'寫入軟件信息
TableEnd()
'Html表格結(jié)尾
HtmlWriteEnd()
'Html文檔結(jié)束
ResultFile.close 
Wscript.Echo "查詢完成!"
'=========以下是函數(shù)列表==========

Function OsWrite() 
  '函數(shù),寫入操作系統(tǒng)信息
 Set colOs =objswbemservices.execquery("select * from win32_operatingsystem",,48)
 For Each Ositem In colOs
  oscaption = Ositem.caption
  OsVersion = oscaption & Ositem.version
  WriteTable "操作系統(tǒng)",OsVersion
 Next
End Function 

Function BoardWrite()
  '函數(shù),寫入主板信息
 Set colBoard = objswbemservices.execquery("select * from win32_baseboard")
 For Each Bditem In colBoard
  boardname = Bditem.product
  WriteTable "主板",boardname
 Next
End Function 

Function CpuWrite()
  '函數(shù),寫入CPU信息
 Set colCpu =objswbemservices.execquery("select * from win32_processor")
 For Each item in colCpu
  cpuname = (trim(item.name))
  WriteTable "中央處理器",cpuname
 Next
End Function 
Function MemoryWrite()
  '函數(shù),寫入內(nèi)存信息
mtotal = 0
num  = 0
mill  = 0
 Set colMemory = objswbemservices.execquery("select * from win32_physicalmemory",,48)
 For Each objitem In colMemory
  mill = objitem.capacity/1048576
  WriteTable "單根內(nèi)存容量",mill & "M"
  mtotal = mtotal+mill
  num = num + 1
 Next
 WriteTable "總計(jì)內(nèi)存",num & "條" & "一共" & mtotal & "M"
End Function 
Function HarddiskWrite()
  '函數(shù),寫入硬盤信息
 Set colDisk = objswbemservices.execquery("select * from win32_diskdrive", , 48)
 For Each objitem In colDisk
  diskname= objitem.caption
  disksize= fix(objitem.size/1073741824)
  WriteTable "硬盤",diskname & " 容量:" & disksize & "G"
 Next
End Function 

Function CdromWrite()
  '函數(shù),寫入CDROM信息
 Set colCdrom = objswbemservices.execquery("select * from win32_cdromdrive where scsitargetid=0")
 For Each objitem In colCdrom
  cdname = objitem.name
  WriteTable "光驅(qū)",cdname
 Next
End Function
Function videoWrite()
  '函數(shù),寫入顯示卡信息
 Set colVideo = objswbemservices.execquery("select * from win32_videocontroller", , 48)
 For Each objitem in colVideo
  videoname = (trim(objitem.caption) & (objitem.videomodedescription)) 
  WriteTable "顯示卡",videoname
 Next
End Function 

Function netcardWrite()
  '函數(shù),查詢網(wǎng)卡信息
 Set colNetcards = objswbemservices.execquery("select * from win32_networkadapter")
  For Each objNetcard in colNetcards
  If Not IsNull(objNetcard.NetConnectionID) Then
NetCardName  = objNetcard.productname
 WriteTable "網(wǎng)卡名稱",NetCardName

If objNetcard.NetConnectionStatus = 2 Then 
NetCardMac  = objNetcard.macaddress
WriteTable "網(wǎng)卡Mac",NetCardMac
strQueryIp ="select * from win32_networkadapterconfiguration" &_
" where IPEnabled = true" &_
" and macaddress = '" & objNetcard.macaddress & "'"
Set colNetcardCfgs = objswbemservices.execquery(strQueryIp) 
For Each objNetcardCfg in colNetcardCfgs  
 For Each CfgAdrress in objNetcardCfg.IPAddress
  IpAdrress = CfgAdrress
  WriteTable "IP地址",IpAdrress
 Next
Next 
Else
NetCardMac = "網(wǎng)卡被禁用或未連接。"
WriteTable "網(wǎng)卡Mac",NetCardMac
IpAdrress = "網(wǎng)卡被禁用或未連接。"  
WriteTable "IP地址",IpAdrress 

End If
 
  End if

  Next
End Function 
Function softlist()
  '函數(shù),寫入軟件信息
Set StdOut = WScript.StdOut 
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv") 
strKeyPath = UNINSTALL_ROOT 
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys 
For Each strSubKey In arrSubKeys 
 If NotHotfix(strSubKey) Then  
  SoftNameAndVersion = getProgNameAndVersion(oReg,strKeyPath & "\" & strSubKey)
  If SoftNameAndVersion<>"0" Then 
  WriteTable "軟件",SoftNameAndVersion  
  End If 
 End If
Next
End Function
Function NotHotfix(sSubKey) 
 If Left(sSubkey,2) = "KB" And len(sSubkey) = 8 Then
  NotHotfix = 0
 Else NotHotfix = 1
 End if
End Function
Function getProgNameAndVersion(oReg,sKeyRoot)
Dim sKeyValuesAry, iKeyTypesAry, nCnt, sValue, sDisplayName, sDisplayVersion
oReg.EnumValues HKEY_LOCAL_MACHINE, sKeyRoot, sKeyValuesAry, iKeyTypesAry
 If NOT IsArray(sKeyValuesAry) Then 
  getProgNameAndVersion = 0
  Exit Function 
 End If
 For nCnt = 0 To UBound(sKeyValuesAry)
  If InStr(1, sKeyValuesAry(nCnt), "DisplayName", vbTextCompare) Then
If iKeyTypesAry(nCnt) = REG_SZ Then
 oReg.GetStringValue HKEY_LOCAL_MACHINE, sKeyRoot, sKeyValuesAry(nCnt), sValue
 If sValue<>"" Then 
  sDisplayName = sValue 
  sDisplayName = Replace(sDisplayName, "[", "(")
  sDisplayName = Replace(sDisplayName, "]", ")")
 End If
End If
  ElseIf InStr(1, sKeyValuesAry(nCnt), "DisplayVersion", vbTextCompare) Then
If iKeyTypesAry(nCnt) = REG_SZ Then
 oReg.GetStringValue HKEY_LOCAL_MACHINE, sKeyRoot, sKeyValuesAry(nCnt), sValue
 If sValue<>"" Then sDisplayVersion = sValue
End If
  End If
  If (sDisplayName<>"") AND (sDisplayVersion<>"") Then 
getProgNameAndVersion = sDisplayName & " --版本號: " & sDisplayVersion
Exit Function
  Else  getProgNameAndVersion = 0
  End If
 Next
 If sDisplayName<>"" Then 
  getProgNameAndVersion = sDisplayName
  Exit Function  
 End If
End Function

Function WriteTable(caption,value)
  '函數(shù),將數(shù)據(jù)寫入HTML單元格
resultFile.Writeline "<tr>"
resultFile.Writeline "<td align=""left"" width=""30%"" height=""25"" bgcolor=""#ffffff"" scope=""row"">&nbsp;&nbsp;" & caption & "</td>"
resultFile.Writeline "<td bgcolor=""#ffffff"">&nbsp;&nbsp;" & value & "</td>"
resultFile.Writeline "</tr>"
End Function 
Function HtmlWriteHead()
  '函數(shù),寫入THML文件頭
resultFile.Writeline "<html>" 
resultFile.Writeline "<head>" 
resultFile.Writeline "<title>軟硬件配置清單</title>"
resultFile.Writeline "</head>" 
resultFile.Writeline "<body>" 
End Function 

Function HtmlWriteEnd()
  '函數(shù),寫入Html文件尾
resultFile.Writeline "</body>" 
resultFile.Writeline "</html>" 
End Function 
Function TableHead(pcname,str)
  '函數(shù),寫入Html表格結(jié)尾
resultFile.Writeline "<h3>" & pcname & str & " -- date:"&now()&" </h3>" & VbCrLf
resultFile.Writeline "<table width=""90%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" bgcolor=""#0000ff"">" 
resultFile.Writeline "<tr>" 
resultFile.Writeline "<th width=""30%"" height=""25"" bgcolor=""#ffffff"" scope=""col"">資產(chǎn)類型</th>"
resultFile.Writeline "<th bgcolor=""#ffffff"" scope=""col"">查詢結(jié)果值</th>"
resultFile.Writeline "</tr>" 
strstyle = "<th width=""30%"" height=""25"" bgcolor=""#ffffff"" scope=""row"">"
End Function 
Function TableEnd()
  '函數(shù),Html表格結(jié)尾
resultFile.Writeline "</table>" 
End Function 

vbs判斷操作系統(tǒng)

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem in colItems
strOSVersion = objItem.Version
Next
wscript.echo strOSversion
select case strOSversion
case "5.2.3790"
wscript.echo "Windows Server 2003"
case "5.0.2195"
wscript.echo "Windows 2000"
case "5.1.2600"
wscript.echo "Windows XP"
case "6.0.6001"
wscript.echo "windows visita"
Case "6.1.7601"
wscript.echo "Windows Server 2008 r2"
case else
wscript.echo "i don't know"
end select

到此這篇關(guān)于vbs查詢局域網(wǎng)內(nèi)電腦的軟件和硬件列表清單的文章就介紹到這了,更多相關(guān)查詢軟件和硬件列表清單內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部