我在這裏有一個整潔的問題。爲什麼在Windows Server 2008 x64上重命名reg.exe會導致它無法運行?
有一個叫做reg.exe的實用程序,它已經在Windows上運行了一段時間。它非常方便從腳本導入.reg文件,修改腳本中的值等。因此,當爲腳本場景製作副本時(「爲什麼不使用system32中的副本?」 - >「軟件限制策略」,個人pref等),我注意到,重命名它使靜默失敗:
Windows Server 2008的64:
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Windows\system32>reg.exe
ERROR: Invalid syntax.
Type "REG /?" for usage.
C:\Windows\system32>copy reg.exe reg2.exe
1 file(s) copied.
C:\Windows\system32>reg2.exe
C:\Windows\system32>reg2.exe /?
C:\Windows\system32>reg.exe /?
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT | FLAGS ]
Return Code: (Except for REG COMPARE)
0 - Successful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
REG FLAGS /?
C:\Windows\system32>
但與Windows XP x86:在
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\chris>cd \WINDOWS\system32
C:\WINDOWS\system32>reg.exe
Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT ]
Return Code: (Except of REG COMPARE)
0 - Succussful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
C:\WINDOWS\system32>copy reg.exe reg2.exe
1 file(s) copied.
C:\WINDOWS\system32>reg2.exe
Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT ]
Return Code: (Except of REG COMPARE)
0 - Succussful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
C:\WINDOWS\system32>
的WinDbg似乎在告訴我,CRT正在殺死它:
Child-SP RetAddr Call Site
00000000`0016f798 00000000`779d2f8b ntdll!ZwTerminateProcess+0xa
00000000`0016f7a0 000007fe`fe97d832 ntdll!RtlExitUserProcess+0x8b
00000000`0016f7d0 00000000`ffe7f710 msvcrt!cinit+0x13b
00000000`0016f810 00000000`778a495d reg!DynArrayGetItemType2+0x1fc
00000000`0016f850 00000000`779d8791 kernel32!BaseThreadInitThunk+0xd
00000000`0016f880 00000000`00000000 ntdll!RtlUserThreadStart+0x1d
但是因爲我對WinDbg不太熟悉(而且這個是64位,所以說,Ollydbg失敗了),我在這裏有點不知所措。感謝您提供的任何信息。
編輯
由於CyberShadow的幫助和Google檢索的,我找到了解決方案:它查找的.mui(這是翻譯)在安裝當前語言的子文件夾。
Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd en-US
C:\Windows\System32\en-US>copy reg.exe.mui reg2.exe.mui
1 file(s) copied.
C:\Windows\System32\en-US>cd ..
C:\Windows\System32>reg2
ERROR: Invalid syntax.
Type "REG /?" for usage.
C:\Windows\System32>del en-US\reg2.exe.mui
C:\Windows\System32>reg2
C:\Windows\System32>
我在Win7 x64上看到了同樣的情況。將reg.exe複製到另一個目錄將以同樣的方式失敗。看起來像一個安全檢查,以確保您正在從系統目錄正確運行「reg.exe」。 – karoberts 2010-02-23 18:09:36