/cygdrive/c和c:\是不同的

/cygdrive/c和c:\是不同的,c,cygwin,mount,windows-8.1,C,Cygwin,Mount,Windows 8.1,我试图在Windows 8.1上通过OpenSSH运行批处理脚本,但收到以下消息: bash: /cygdrive/c/Windows/System32/boot8.bat: No such file or directory 不知何故,cygwin环境没有正确地将C:\映射到/cydrive/C 为了确保这一点,mount说: $ mount C:/cygwin/bin on /usr/bin type ntfs (binary,auto) C:/cygwin/lib on /usr/lib

我试图在Windows 8.1上通过OpenSSH运行批处理脚本,但收到以下消息:

bash: /cygdrive/c/Windows/System32/boot8.bat: No such file or directory
不知何故,cygwin环境没有正确地将C:\映射到/cydrive/C

为了确保这一点,mount说:

$ mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
因此,使用cygwin shell我得到了以下结果:

$ ls -Al /cygdrive/c/Windows/System32 | grep  boot
-rwxrwx---+  2 TrustedInstaller TrustedInstaller     3072 Aug 22 06:14 api-ms-win-base-bootconfig-l1-1-0.dll
-rwxrwx---+  2 TrustedInstaller TrustedInstaller  3170304 Jun 18 14:43 boot.sdi
-rwxrwx---+  2 TrustedInstaller TrustedInstaller    79360 Aug 22 05:49 bootcfg.exe
但是,如果我使用cmd窗口,我可以看到文件:

C:\Windows\System32>dir | findstr boot
22/08/2013  12:21           165,376 bcdboot.exe
18/06/2013  16:08         3,170,304 boot.sdi
01/08/2013  15:24               290 boot7.bat
04/11/2013  16:00               298 boot8.bat
22/08/2013  12:15            87,040 bootcfg.exe
22/08/2013  10:17            13,312 bootim.exe
22/08/2013  13:45           109,408 bootsect.exe
22/08/2013  12:44             2,560 bootstr.dll
22/08/2013  10:07         3,311,616 bootux.dll
19/11/2013  16:42               307 bootxp.bat
使用windows资源管理器,我也可以看到boot8.bat

它在Windows XP和Windows 7下工作。Windows和system32目录是否使用大写字母无关紧要。我以前遇到过这个问题,我用notepad++编辑文件,后来用notepad打开文件时,它们没有改变

有什么想法吗?

试试看

ls -Al /cygdrive/c/Windows/sysnative | grep boot

尝试
ls-al/cygdrive/c/Windows/System32 | grep-i boot
可能是Windows将您对System32目录的访问重定向到syswow64,因为您的cygwin安装是32位的。谢谢,解决了这个问题。我只是在XP和Win7机器上用ln-s做了一个符号链接,这样我就可以使用相同的脚本了。