欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

vbs列出内网的中计算机(工作组也可以)

程序员文章站 2022-04-10 08:18:45
复制代码 代码如下: 'handle errors on error resume next 'get the provider object set prov = get...
复制代码 代码如下:

'handle errors
on error resume next
'get the provider object
set prov = getobject("winnt:")

'examine the available domains the provider can reach
for each dom in prov

'examine the objects in the domain and check for computer objects
for each o in dom
if o.class = "computer" then

'display properties of the computer
wscript.echo o.class & " " & o.name
wscript.echo " owner: " & o.owner
wscript.echo " division: " & o.division
wscript.echo " operatingsystem: " & o.operatingsystem
wscript.echo " os version: " & o.operatingsystemversion
wscript.echo " processor: " & o.processor
wscript.echo " processorcount: " & o.processorcount

end if

next
next