未记录的 /c 选项在 regsvr32 中有什么作用

What does the undocumented /c option do in regsvr32

我正在将带有 COM 组件的本机 C++ DLL 从 Visual Studio 6.0 更新到 Visual Studio 2019。原始项目有一个 post 构建事件来注册 DLL

regsvr32 /s /c my.dll

查看 regsvr32 的帮助屏幕,未列出 /c 选项,在线搜索甚至 Microsoft 在线文档都没有在 regsvr32 的 /c 选项上找到任何内容。我意识到使用 VS2019 我可以 select Linker Properties 下的 register output 选项,但我想知道原因是什么原始项目中的 /c 选项。

选项 /c 似乎是有效的,因为使用它不会生成错误消息,而使用其他无效选项会生成错误消息。上面的帮助屏幕是用

生成的
regsvr32 /z my.dll

在 Windows 2000 年之前,regsvr32 /c 用于将其输出发送到控制台(而 VC++ 6 可以追溯到 1998 年,当时 NT 3.x/4 .0 还活着而且很好)。

JSI Tip 6434 中也提到了这一点,更正了 Q288373 中的“ 到计算机 ” 拼写错误。

In Windows NT 4.0 and other previous operating systems, you could use the /C switch with Regsvr32.exe to send output to the console, which allowed you to script the process and test for the result. This functionality is no longer included in Windows NT 5.0 and higher.