相思资源网 Design By www.200059.com

这里先给大家分享一个分配静态ip地址的代码

' Assign a Static IP Address


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
  ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

strIPAddress = Array("192.168.6.98")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.6.1")
strGatewayMetric = Array(1)
 
For Each objNetAdapter in colNetAdapters
  errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
  errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
  If errEnable = 0 Then
    WScript.Echo "The IP address has been changed."
  Else
    WScript.Echo "The IP address could not be changed."
  End If
Next

检测U盘 方法一

'方法1
Sub"Scripting.FileSystemObject")
"B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
",")
":\\")))
"""Sheet1!d8")"Sheet1!d8")"系统未检测到U盘!"
"winmgmts:\\.\root\cimv2")
"Select")
"Scripting.FileSystemObject").GetDrive(RemovableDrive).IsReady"Scripting.FileSystemObject").GetDrive(RemovableDrive).SerialNumber
"""Sheet1!d8")"Sheet1!d8")"系统未检测到U盘!"
"winmgmts:\\.\root\cimv2")
"Select")
"Sheet1!E8")"Select")
"Sheet1!F8")"SELECT")
"Sheet1!G8") = objItem.MACAddress
        Exit For
    Next
    Set colItems = Nothing
   
End Sub

好了,这里就先介绍到这,需要的朋友可以参考一下。

标签:
vbs,网卡MAC,CPUID,硬盘序列号

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“用vbs脚本获取网卡MAC,CPUID,硬盘序列号的实现代码”

暂无用vbs脚本获取网卡MAC,CPUID,硬盘序列号的实现代码的评论...