c -/cygdrive/c 和 C :\are different

标签 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 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++ 编辑文件,后来用记事本打开它们时,它们没有改变。

有什么想法吗?

最佳答案

尝试

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

关于c -/cygdrive/c 和 C :\are different,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20076504/

相关文章:

c - 为什么这个错误 "pngrutil.c:27:error: expected ‘;’ , ‘,’ or ‘)’ before ‘=’ token"in the following function?

c++ - 在cygwin下链接makefile中的boost库

c++ - GCC 与 Cygwin/Win7 : missing syscall. h

c - Linux 中的非阻塞挂载

CUDA:查找 100x100 矩阵中的最小值

从 Linux 编译到 Windows

c - 如何在c中使用数组存储字符串?

Vim 命令 :Explore :Sexplore :Hexplore doesn't work in cygwin

linux - 等待/dev/disk/by-label 在 SD 插入后填充

c - 如何使用 C 程序在没有 root 访问权限的情况下挂载文件系统?