找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 14873|回复: 2

[问题求助] 如何用VBS远程获得AD中客户机器的软件安装列表

[复制链接]
发表于 2014-9-3 10:04:23 | 显示全部楼层 |阅读模式
需求是这样的,我想知道如何在用户不知道的状态下获得这台计算机的appwiz的列表。
 楼主| 发表于 2014-9-3 11:09:40 | 显示全部楼层
木有人会么
发表于 2014-9-3 14:32:12 | 显示全部楼层
回复 2# dog542
我不会…但是度娘知道:
获取域内电脑所安装的软件(VBS)  
http://blog.163.com/huang_senlin ... 910920108297836601/
2010-09-29 19:08:36

这两天老大要查每台电脑安装了哪些软件,200台电脑呀,快跑得蹆抽筋啦!!没办法,只好想点法子!因为所有电脑已经加入域,好办,用组策略脚本,在此分享给需要的朋友。以下脚本功能:把注册表的软件列表读出来,然后写入一个文本文件!FilePath为这个文件保存的路径。另外,此列表筛选去除了一些系统的补丁更新。

  1. '*************************************************
  2. ' Script : Check Computer Application List  
  3. 'Last Mondify:By Alin(slin0511@163.com)
  4. '*************************************************

  5. On Error Resume Next      

  6. Const HKLM         = &H80000002   
  7. Const strKeyPath   = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
  8. Const ForReading   = 1   
  9. Const ForAppending = 8  
  10.   
  11. '*****************************************************************
  12. 'Please change the path of the file where you want to save it!!!!
  13. '*****************************************************************
  14. Const FilePath     ="\\publicserver\public\exchange"
  15. Set Wshell         = CreateObject("Wscript.Shell")   
  16. Set objFSO         = CreateObject("Scripting.FileSystemobject")   

  17. '*****************************************************************
  18. 'Get the computer name!!!!
  19. '*****************************************************************
  20. Dim WshNetwork
  21. Set WshNetwork = WScript.CreateObject("WScript.Network")
  22. strComputer = WshNetwork.ComputerName  

  23. '*****************************************************************
  24. 'Delete the txt file if it is exist !!!!
  25. '*****************************************************************
  26. Set MyFile = objFSO.GetFile(FilePath & WshNetwork.ComputerName &".txt")
  27. MyFile.Delete

  28. '*****************************************************************
  29. 'Create the txt file and write the application list to the file !!!!
  30. '*****************************************************************
  31. Set textWriteFile  = objFSO.OpenTextFile(FilePath & WshNetwork.ComputerName &".txt",forappending,True)

  32. Do      

  33. Set objReg  = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")   
  34. objReg.EnumKey HKLM, strKeyPath,arrSubKeys   

  35.   For Each strSubKey In arrSubKeys        
  36.     intRet = objReg.GetStringValue(HKLM, strKeyPath & strSubKey,"DisplayName",strValue)                              

  37.         If strValue <> "" And intRet = 0 And inStr(1,strValue,"windows",1)<=0 Then
  38.                 CScript.Echo strComputer & "    " & strValue
  39.                 textWriteFile.WriteLine(strComputer & "    " & strValue)
  40.              End If                  

  41.         
  42.          If strValue <> "" And intRet = 0 And inStr(1,strValue,"Java",1) >0 Then

  43.                 CScript.Echo strComputer & "    " & strValue
  44.                  textWriteFile.WriteLine(strComputer & "    " & strValue)
  45.              End If                  

  46. Next

  47. Loop Until objFile.AtEndOfStream      
  48. textWriteFile.Close   
  49. objFile.Close
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 16:57 , Processed in 0.017688 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表