寻找一个脚本/工具来转储 Windows Server 2008 R2 上已安装的功能和程序的列表

发布于 2024-08-25 04:35:27 字数 199 浏览 6 评论 0原文

同一个编译的 .Net / C++ / Com 程序在两台看似相同的计算机上执行不同的操作。两者都安装了数十个东西。我想通过查看 ASCII 差异来找出两者之间的区别。在此之前,我需要以简单可读的格式“序列化”已安装内容的列表 - 按字母顺序排序+每行一个项目。

Python 脚本是理想的选择,但我还安装了 Perl、PowerShell。

谢谢。

The same compiled .Net / C++ / Com program does different things on two seemingly same computers. Both have DOZENS of things installed on them. I would like to figure out what the difference between the two is by looking at an ASCII diff. Before that I need to "serialize" the list of installed things in a plain readable format - sorted alphabetically + one item per line.

A Python script would be ideal, but I also have Perl, PowerShell installed.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

逆光下的微笑 2024-09-01 04:35:27

您可以从注册表中获取已安装程序的列表。它位于 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

如果这是一次性练习,您甚至可能不需要编写任何代码 - 只需使用 Regedit 将密钥导出到 .REG 文件。如果你确实想自动化它,Python 提供了 _winreg 模块用于注册表访问。

You can get the list of installed programs from the registry. It's under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

If this is a once-off exercise you may not even need to write any code - just use Regedit to export the key to a .REG file. If you do want to automate it Python provides the _winreg module for registry access.

海未深 2024-09-01 04:35:27

Microsoft 提供的两种工具可能正是您所需要的:RegDumpRegDiff。您可以从各个地方下载它们,包括Microsoft Vista 徽标测试工具包的一部分。

此外,还有 Microsoft 支持文章如何使用 WinDiff 比较注册表文件

对于Pythonic方式,这里是一个ActiveState配方,用于获取所有子项的格式化输出特定键(例如 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall)。

There are two tools from Microsoft that may be what you need: RegDump and RegDiff. You can download them from various places, including as part of the Microsoft Vista Logo Testing Toolkit.

Also, there is Microsoft Support article How to Use WinDiff to Compare Registry Files.

For a Pythonic way, here is an ActiveState recipe for getting formatted output of all the subkeys for a particular key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for example).

落在眉间の轻吻 2024-09-01 04:35:27

就我个人而言,我一直喜欢 sysinternals 的东西(功能强大、轻便、实用的工具 - 无需安装)

有命令行工具 psinfo 可以在本地或远程计算机上以各种格式获取您想要的内容(以及一些),区分修补程序和已安装的软件(前提是系统策略允许在远程进行)。

您还可以从此处实时运行它,因此虽然不是严格意义上的Pythonic,但您可以将其插入相当很好。

Personally I always liked sysinternals' stuff (powerfull, light, actual tools - no need to install)

There is command line tool psinfo that can get you what you want (and then some) in various formats, distinguishing hotfixes and installed software, on local or remote computer (providing system policies allow it on remote).

You can also run it live from here, so though not strictly pythonic you could plug it in quite nicely.

却一份温柔 2024-09-01 04:35:27

摘自从命令行列出已安装的软件< /a>:

如果您想列出 Windows 管理已知的软件
来自命令行的 Instrumentation (WMI),使用 WMI 命令行
(WMIC)接口。

要列出本地安装的所有产品,请运行以下命令
命令:

wmic 产品

警告:此命令似乎仅列出通过 Windows Installer 安装的软件。请参阅 Win32_Product 类

Taken from List installed software from the command line:

If you want to list the software known to Windows Management
Instrumentation (WMI) from the command line, use WMI command line
(WMIC) interface.

To list all products installed locally, run the following
command:

wmic product

Caveat: It seems that this command only list software installed through Windows Installer. See Win32_Product class

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文