我对VBS不熟,以前倒是有个例子,可惜找不着了。下面这个不知可否解燃眉之急:ComputerName = InputBox("Enter the name of the computer you wish to query")set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &"").ExecQuery("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
set IPConfigSet = GetObject("localhost")for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo "IPAddress: " & IPConfig.IPAddress(i)
next
end if
next运行方法:
1.将以上代码存为ip.vbs,放到c:\下;
2.进入DOS方式,输入:wscript ip.vbs,在弹出地窗口中输入:localhost
set IPConfigSet = GetObject("localhost")for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo "IPAddress: " & IPConfig.IPAddress(i)
next
end if
next运行方法:
1.将以上代码存为ip.vbs,放到c:\下;
2.进入DOS方式,输入:wscript ip.vbs,在弹出地窗口中输入:localhost
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货