如何获取Windows上已安装的软件列表?
搜索关键字:
- http://search.aol.com/aol/search?q=how+to+get+windows+installed+software+list
- http://search.aol.com/aol/search?q=vbscript+how+to+get+windows+installed+software+list
注意事项:
需要循环遍历以下3个注册表键值才可能取得全(否则经常会有漏记的):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
简单示例:
PowerShell
Get-WmiObject -Class Win32_Product | Select-Object -Property Name > D:\PCapps.txt
WMIC
/output:D:\InstallList.txt product get name,version
示例2:
Dim objNetwork, objReg Dim HOSTNAME, USERNAME Dim OS_ARCH '初始化对象 Set objNetwork = CreateObject("WScript.Network") if Err <> 0 or Not IsObject(objNetwork) then DisplayCustomError "CreateObject WScript.Network failed" Wscript.Quit end if Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") if Err <> 0 or Not IsObject(objReg) then DisplayCustomError "CreateObject StdRegProv failed" Wscript.Quit end if '获取主机名/用户名 HOSTNAME = objNetwork.ComputerName USERNAME = objNetwork.UserName OS_ARCH = func_get_os_type() Function func_get_os_type() Dim ObjectWMI, colItems, objItem, X86orX64 Set ObjectWMI = GetObject("winmgmts:\\.\root\cimv2") if Err <> 0 or Not IsObject(ObjectWMI) then DisplayCustomError "GetObject \root\cimv2 failed" exit function end if Set colItems = ObjectWMI.ExecQuery("Select * from Win32_ComputerSystem",,48) if Err <> 0 or Not IsObject(colItems) then DisplayCustomError "Query Win32_ComputerSystem failed" exit function end if For Each objItem in colItems If InStr(objItem.SystemType, "86") <> 0 Then X86orX64 = "x86" ElseIf InStr(objItem.SystemType, "64") <> 0 Then X86orX64 = "x64" Else X86orX64 = objItem.SystemType End If Next func_get_os_type = X86orX64 Set colItems = Nothing Set ObjectWMI = Nothing End Function Dim subkey, Result Dim subkey1, subkey2 Dim SystemManufacturer, SystemProductName, SystemFamily, SystemVersion Dim BuildLab, BuildLabEx, CSDBuildNumber, CSDVersion, CurrentBuildNumber, CurrentVersion, EditionID, InstallationType, InstallDate, ProductName '获取硬件信息 subkey1 = "SYSTEM\CurrentControlSet\Control\SystemInformation" subkey2 = "HARDWARE\DESCRIPTION\System\BIOS" objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey1, "SystemManufacturer", SystemManufacturer objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey1, "SystemProductName", SystemProductName objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey2, "SystemFamily", SystemFamily objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey2, "SystemVersion", SystemVersion '获取操作系统信息 subkey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion" objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "BuildLab", BuildLab objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "BuildLabEx", BuildLabEx objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "CSDBuildNumber", CSDBuildNumber objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "CSDVersion", CSDVersion objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "CurrentBuildNumber", CurrentBuildNumber objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "CurrentVersion", CurrentVersion objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "EditionID", EditionID objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "InstallationType", InstallationType objReg.GetDWORDValue HKEY_LOCAL_MACHINE, subkey, "InstallDate", InstallDate objReg.GetStringValue HKEY_LOCAL_MACHINE, subkey, "ProductName", ProductName
参考链接:
- List Installed Software Features – [ok]
- http://stackoverflow.com/questions/11872290/vbscript-list-installed-softwares-on-windows-server-2008-r2
- http://blogs.technet.com/b/onescript/archive/2013/10/15/script-of-oct-15-script-to-get-installed-software-through-registry-vbscript.aspx
- http://stackoverflow.com/questions/673233/wmi-installed-query-different-from-add-remove-programs-list
- http://superuser.com/questions/68611/get-list-of-installed-applications-from-windows-command-line
- http://myitforum.com/cs2/blogs/yli628/archive/2008/01/16/powershell-script-to-list-installed-software-on-local-computer.aspx
- http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/13/use-powershell-to-quickly-find-installed-software.aspx
- http://helpdeskgeek.com/how-to/generate-a-list-of-installed-programs-in-windows/
- http://www.howtogeek.com/165293/how-to-get-a-list-of-software-installed-on-your-pc-with-a-single-command/
- Script List All Installed Software
- Script samples / Applications / Client Applications / List All Installed Software
使用VBScript进行文件读写操作
- http://stackoverflow.com/questions/1142678/read-and-write-into-a-file-using-vbscript
- http://www.motobit.com/tips/detpg_asp-vbs-read-write-ini-files/
- http://stackoverflow.com/questions/2198810/creating-and-writing-lines-to-a-file
示例:
'将数据写入文件 function func_write_to_file(filename, data) Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile(filename, True) #注意是CreateTextFile而不是OpenTextFile f.Write data f.Close End function '调用方法 func_write_to_file "result.txt", "this is a test string" func_write_to_file "result.txt", "this is a test string" & vbCrLf
《 “如何获取Windows上已安装的软件列表?” 》 有 7 条评论
Windows环境下的信息收集
https://mp.weixin.qq.com/s?__biz=MzI5MDQ2NjExOQ==&mid=2247484666&idx=1&sn=4ce455c0144c7b1474625f541a868876
https://github.com/myh0st/scripts
windows提权系列上篇
https://mp.weixin.qq.com/s/uOArxXIfcI4fjqnF9BDJGA
渗透基础——获得当前系统已安装的程序列表
http://www.4hou.com/technology/10206.html
`
本文将要介绍以下内容:
·通过wmi获取当前系统已安装的程序列表
·wmi查询结果不完整的原因
·获取完整程序列表的实现思路
`
使用 PowerShell 获取远程机器上安装的软件列表
https://sid-500.com/2018/04/02/powershell-how-to-get-a-list-of-all-installed-software-on-remote-computers/
Windows NT 内核版本号对应的操作系统版本号
https://blog.csdn.net/qing666888/article/details/50843640
Windows NT
https://zh.wikipedia.org/wiki/Windows_NT
`
NT 5.0 # Windows 2000
NT 5.1 # Windows XP
NT 5.2 # Windows XP/Server 2003/Server 2003 R2
NT 6.0 # Windows Vista/Server 2008
NT 6.1 # Windows 7/Server 2008 R2
NT 6.2 # Windows 8/Server 2012
NT 6.3 # Windows 8.1/Server 2012 R2
NT 10.0 # Windows 10/Server 2016//Server 2019
`
windows NT的意义和各个版本
https://blog.csdn.net/flyingpig2016/article/details/53282895/
Windows NT是什么? Windows NT内核是什么?版本号对应操作系统介绍
http://www.winwin7.com/JC/Win7JC-6960.html
`
版本格式:开始日期-服务结束日期
Microsoft Windows NT 3.1 (1993-2000) 7年
Microsoft Windows NT 3.5 (1994-1995) 1年
Microsoft Windows NT 3.51 (1995-2001) 6年
Microsoft Windows NT 4.0 (1996-2007) 11年
Microsoft Windows 2000 (Windows NT 5.0) (1999) (2000-2010) 10年
Microsoft Windows XP (Windows NT 5.1) (2001-2014.4.8) 13年
Microsoft Windows Server 2003 (Windows NT 5.2) (2003-2015) 12年
Microsoft Windows Server 2003 R2 (Windows NT 5.2) (2006-2015) 9年
Microsoft Windows Vista (Windows NT 6.0) (2006-2017) 11年
Microsoft Windows Server 2008 (Windows NT 6.0) (2008-2018) 10年
Microsoft Windows 7 (Windows NT 6.1) (2009-2020) 11年
Microsoft Windows Server 2008 R2 (Windows NT 6.1) (2009-2018) 9年
Microsoft Windows 8.0 (Windows NT 6.2) (2012-2016) 4年
Microsoft Windows Server 2012(Windows NT 6.2) (2012-2023) 11年
Microsoft Windows Phone 8 (Windows NT 6.2) (2012-2014) 2年
Microsoft Windows 8.1 (未安装更新的)(Windows NT 6.3) (2013-2014) 1年
Microsoft Windows 8.1 (已安装更新的)(Windows NT 6.3) (2013-2023)10年
Microsoft Windows Server 2012 R2 (Windows NT 6.3) (2013-2023) 11年
Microsort Windows 10【Windows NT 10.0】【2015至2025年】
`
Windows上的一些应急响应可以使用的工具:火绒剑、安天
火绒安全软件
https://www.huorong.cn/person5.html
安天发布的一些工具
https://www.antiy.com/tools.html
Windows的无人值守安装(Unattended Installation for Windows)
http://www.elliecomputing.com/en/OnlineDoc/ecmerge_EN/111706292.asp
The Inno Setup install parameters that are required for silent installation.
https://www.silentinstall.org/inno_setup/
`
/SILENT Runs the installer in silent mode (The progress window is displayed)
/VERYSILENT Very silent mode. No windows are displayed.
/SUPPRESSMSGBOXES Suppress message boxes. Only has an effect when combined with ‘/SILENT’ and ‘/VERYSILENT’.
/NOCANCEL Disables cancelling the installation process.
/NORESTART Prevents installer from restarting the system even if it’s necessary.
/DIR=”x:\dirname” Overrides the default install directory.
# Example
Silently install the program, prevent restarting the system.
$ setup.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
`