标题: [问题求助] 如何用VBS远程获得AD中客户机器的软件安装列表 [打印本页]
作者: dog542 时间: 2014-9-3 10:04 标题: 如何用VBS远程获得AD中客户机器的软件安装列表
需求是这样的,我想知道如何在用户不知道的状态下获得这台计算机的appwiz的列表。
作者: dog542 时间: 2014-9-3 11:09
木有人会么
作者: yu2n 时间: 2014-9-3 14:32
回复 2# dog542
我不会…但是度娘知道:
- '*************************************************
- ' Script : Check Computer Application List
- 'Last Mondify:By Alin(slin0511@163.com)
- '*************************************************
-
- On Error Resume Next
-
- Const HKLM = &H80000002
- Const strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
- Const ForReading = 1
- Const ForAppending = 8
-
- '*****************************************************************
- 'Please change the path of the file where you want to save it!!!!
- '*****************************************************************
- Const FilePath ="\\publicserver\public\exchange"
- Set Wshell = CreateObject("Wscript.Shell")
- Set objFSO = CreateObject("Scripting.FileSystemobject")
-
- '*****************************************************************
- 'Get the computer name!!!!
- '*****************************************************************
- Dim WshNetwork
- Set WshNetwork = WScript.CreateObject("WScript.Network")
- strComputer = WshNetwork.ComputerName
-
- '*****************************************************************
- 'Delete the txt file if it is exist !!!!
- '*****************************************************************
- Set MyFile = objFSO.GetFile(FilePath & WshNetwork.ComputerName &".txt")
- MyFile.Delete
-
- '*****************************************************************
- 'Create the txt file and write the application list to the file !!!!
- '*****************************************************************
- Set textWriteFile = objFSO.OpenTextFile(FilePath & WshNetwork.ComputerName &".txt",forappending,True)
-
- Do
-
- Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")
- objReg.EnumKey HKLM, strKeyPath,arrSubKeys
-
- For Each strSubKey In arrSubKeys
- intRet = objReg.GetStringValue(HKLM, strKeyPath & strSubKey,"DisplayName",strValue)
-
- If strValue <> "" And intRet = 0 And inStr(1,strValue,"windows",1)<=0 Then
- CScript.Echo strComputer & " " & strValue
- textWriteFile.WriteLine(strComputer & " " & strValue)
- End If
-
-
- If strValue <> "" And intRet = 0 And inStr(1,strValue,"Java",1) >0 Then
-
- CScript.Echo strComputer & " " & strValue
- textWriteFile.WriteLine(strComputer & " " & strValue)
- End If
-
- Next
-
- Loop Until objFile.AtEndOfStream
- textWriteFile.Close
- objFile.Close
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |