vbs怎么实现将文件上传到服务器,自动写入文件上传到指定服务器SoftwareMeteringCLS.vbs源码...

这段代码展示了如何使用VBScript(SoftwareMeteringCLS.vbs)获取远程主机上安装的软件列表,通过WMI连接远程计算机,遍历注册表项以获取DisplayName和DisplayVersion信息。该脚本适用于从WSF脚本调用,并可以处理目标系统不存在或无WMI的情况。
摘要由CSDN通过智能技术生成

复制代码 代码如下:

' FileName: SoftwareMeteringCLS.vbs

'

If (WScript.ScriptName = "SoftwareMeteringCLS.vbs") Then Call demo_SoftwareMeteringCLS()

' ====================================================================

Function getSoftwareList(sHost)

' Callable by *.wsf; will return list (safe array) of installed

' software on the sHost system (sHost is ComputerName or IP address).

'

' The assumption is that sHost is available and has WMI installed.

Set oSoftMeter = new SoftwareMeteringCLS

sProgsAry = oSoftMeter.getList(sHost)

Set oSpftMeter = Nothing

getSoftwareList = sProgsAry

End Function

' ====================== CLASS =======================================

Class SoftwareMeteringCLS

' Author: Branimir Petrovic

' Date: 6 Sept 2002

' Version: 1.0.3

'

' Revision History:

' 30 March 2002 V 1.0.0

'

' 08 April 2002 V 1.0.1

' Added error handling - if the target system is not present,

' or does not have WMI, getList(sHost) will return empty list.

'

' Added global function getSoftwareList(sHost) to be used

' from *.wsf scripts when caller script is JScript (since

' JScript can not instantiate VBS classes directly).

'

' 21 April 2002 V 1.0.2

' Replacing "[" with "(" and "]" with ")" in "Displ

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值