为什么我不能从命令行从C:\SysWOW64复制DLL? [英] Why can't I copy a DLL from C:\SysWOW64 from the command line?
问题描述
如果我尝试将文件从 C:\SysWOW32\
从命令行使用复制
在Windows 7 64位,我其实最终得到该文件位于 C:\System32\
中。为什么会发生这种情况?
确定 - dumpbin能够区分DLL文件
C:\Users\user\Desktop> dumpbin / headers C:\Windows\System32\opengl32.dll | grep机
8664机器(x64)
C:\Users\user\Desktop> dumpbin / headers C:\Windows\SysWOW64\opengl32.dll | grep机
14C机(x86)
32位字机
NOT OK - 其他命令,如md5sum(从 GOW )得到错误的字节!
C:\Users\user\Desktop> md5sum C:\Windows\system32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 * C:\\Windows\\\system32\\opengl32.dll
C:\Users\user\Desktop> md5sum C:\\ \\ Windows \SysWow64\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 * C:\\Windows\\\SysWow64\\opengl32.dll
NOT OK - 使用命令行复制64位DLL
C:\Users\user\Desktop>复制C:\Windows\System32\opengl32.dll。
1个文件被复制。
C:\Users\user\Desktop> dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C :\Users\user\Desktop> md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 * opengl32.dll
C:\Users\user\Desktop> dumpbin / headers opengl32.dll | grep机
14C机(x86)
32位字机
错误!为什么32位DLL被复制?
确定 - 使用命令行复制32位DLL
C:\Users\user\Desktop>复制C:\Windows\SysWOW64\opengl32.dll。
覆盖.\opengl32.dll? (是/否/全部):是
1复制文件。
C:\Users\user\Desktop> dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C :\Users\user\Desktop> md5sum C:\Windows\System32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 * C:\\Windows\\\System32\\opengl32 .dll
C:\Users\user\Desktop> dumpbin / headers opengl32.dll | grep机
14C机(x86)
32位字机
OK - 使用资源管理器复制64位DLL
< control-drag System32 \opengl32.dll到桌面>
C:\Users\user\Desktop> dir opengl32.dll
07/13/2009 06:41 PM 1,039,872 opengl32.dll
C :\Users\user\Desktop> md5sum opengl32.dll
585fed4cdb8034b8b58aeb8008255817 * opengl32.dll
C:\Users\user\Desktop> dumpbin / headers opengl32.dll | grep机
8664机器(x64)
确定 - 复制一个32位使用资源管理器的DLL
< control-drag SysWow64\opengl32.dll到桌面>
C:\Users\user\Desktop> dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C :\Users\user\Desktop> md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 * opengl32.dll
C:\Users\user\Desktop> dumpbin / headers opengl32.dll | grep机
14C机(x86)
32位字机
说明这里发生了什么?
您看到的行为是由 SysWOW64文件系统重定向
md5sum.exe
是一个32位二进制文件,所以当它请求 C:\Windows\System32\opengl32.dll
,文件系统返回 C:\Windows\SysWOW64\opengl32.dll
。
同样,如果启动了32位提示符( C:\Windows\SysWOW64\cmd.exe
),执行复制
操作并输入参数 C:\Windows\System32\opengl32.dll
, C:\ Windows\SysWOW64\opengl32.dll
被复制
I know what I'm doing is weird, please don't worry about that. What is happening, however, is absolutely insane.
If I try to copy a DLL file from C:\SysWOW32\
from the command line using copy
on Windows 7 64-bit, I actually end up getting the file that's in C:\System32\
. Why is this happening?
OK - dumpbin is able to differentiate the DLL files
C:\Users\user\Desktop>dumpbin /headers C:\Windows\System32\opengl32.dll | grep machine
8664 machine (x64)
C:\Users\user\Desktop>dumpbin /headers C:\Windows\SysWOW64\opengl32.dll | grep machine
14C machine (x86)
32 bit word machine
NOT OK - Other commands, like md5sum (from GOW) get the wrong bytes!
C:\Users\user\Desktop>md5sum C:\Windows\system32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\system32\\opengl32.dll
C:\Users\user\Desktop>md5sum C:\Windows\SysWow64\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\SysWow64\\opengl32.dll
NOT OK - Copying a 64-bit DLL using the command line
C:\Users\user\Desktop>copy C:\Windows\System32\opengl32.dll .
1 file(s) copied.
C:\Users\user\Desktop>dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C:\Users\user\Desktop>md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 *opengl32.dll
C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
14C machine (x86)
32 bit word machine
Wrong! Why did the 32-bit DLL get copied??
OK - Copying a 32-bit DLL using the command line
C:\Users\user\Desktop>copy C:\Windows\SysWOW64\opengl32.dll .
Overwrite .\opengl32.dll? (Yes/No/All): yes
1 file(s) copied.
C:\Users\user\Desktop>dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C:\Users\user\Desktop>md5sum C:\Windows\System32\opengl32.dll
\d1bbe227367ed791d5fcf08e132d2956 *C:\\Windows\\System32\\opengl32.dll
C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
14C machine (x86)
32 bit word machine
OK - Copying a 64-bit DLL using Explorer
<control-drag System32\opengl32.dll to desktop>
C:\Users\user\Desktop>dir opengl32.dll
07/13/2009 06:41 PM 1,039,872 opengl32.dll
C:\Users\user\Desktop>md5sum opengl32.dll
585fed4cdb8034b8b58aeb8008255817 *opengl32.dll
C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
8664 machine (x64)
OK - Copying a 32-bit DLL using Explorer
<control-drag SysWow64\opengl32.dll to desktop>
C:\Users\user\Desktop>dir opengl32.dll
07/13/2009 06:16 PM 791,552 opengl32.dll
C:\Users\user\Desktop>md5sum opengl32.dll
d1bbe227367ed791d5fcf08e132d2956 *opengl32.dll
C:\Users\user\Desktop>dumpbin /headers opengl32.dll | grep machine
14C machine (x86)
32 bit word machine
Can anyone explain what's happening here?
The behavior you see is caused by SysWOW64 File System Redirection
md5sum.exe
is a 32-bit binary, so when it requests C:\Windows\System32\opengl32.dll
, the file system returns C:\Windows\SysWOW64\opengl32.dll
.
Similarly, if you launch a 32-bit prompt (C:\Windows\SysWOW64\cmd.exe
), perform a copy
operation and inputs the argument C:\Windows\System32\opengl32.dll
, C:\Windows\SysWOW64\opengl32.dll
is copied
这篇关于为什么我不能从命令行从C:\SysWOW64复制DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!