1

我有一个用 Delphi 编写的 ActiveX Com 服务器。它工作正常。但是,当文件位于有空格的目录中时,我注意到注册它时有所不同。例如,执行命令后。

C:\带空格的路径> AutomationLibrary.exe /regserver

将创建以下键。

HKCR\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 REG_SZ C:\Path With Spaces\AutomationLibrary.exe
HKCR\Wow6432Node\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 REG_SZ C:\Path With Spaces\AutomationLibrary.exe
HKLM\SOFTWARE\Classes\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32    REG_SZ C:\Path With Spaces\AutomationLibrary.exe
HKLM\SOFTWARE\Classes\Wow6432Node\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 C:\Path With Spaces\AutomationLibrary.exe

但是,如果我改为执行以下操作。

C:\Path_No_Spaces> AutomationLibrary.exe /regserver

HKCR\CLSID\{626F20B7-887E-456F-91C5-1BD7E973978D}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe
HKCR\CLSID\{B25708A9-4A44-44AF-915D-7F24C8E0D5AE}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe
HKCR\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 C:\Path_No_Spaces\AutomationLibrary.exe
HKCR\Wow6432Node\CLSID\{626F20B7-887E-456F-91C5-1BD7E973978D}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe 
HKCR\Wow6432Node\CLSID\{B25708A9-4A44-44AF-915D-7F24C8E0D5AE}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe 
HKCR\Wow6432Node\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 C:\Path_No_Spaces\AutomationLibrary.exe
HKLM\SOFTWARE\Classes\CLSID\{626F20B7-887E-456F-91C5-1BD7E973978D}\LocalServer32C:\Path_No_Spaces\AutomationLibrary.exe 
HKLM\SOFTWARE\Classes\CLSID\{B25708A9-4A44-44AF-915D-7F24C8E0D5AE}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe
HKLM\SOFTWARE\Classes\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 C:\Path_No_Spaces\AutomationLibrary.exe    
HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{626F20B7-887E-456F-91C5-1BD7E973978D}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe
HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{B25708A9-4A44-44AF-915D-7F24C8E0D5AE}\LocalServer32 C:\Path_No_Spaces\AutomationLibrary.exe    
HKLM\SOFTWARE\Classes\Wow6432Node\TypeLib\{BFAC1B1F-9520-4B2E-BB92-61D0CDBD7D98}\1.0\0\win32 C:\Path_No_Spaces\AutomationLibrary.exe

为什么会有差异,我该如何解决?双引号似乎不起作用。欢迎提出意见和建议。我在 64 位的 Windows7 Enterprise SP1 上运行它。

4

0 回答 0