Windows 为什么将可执行文件复制到新名称会阻止它运行?

Windows 为什么将可执行文件复制到新名称会阻止它运行?,windows,windows-10,gfortran,msys2,Windows,Windows 10,Gfortran,Msys2,我在Windows10Professional下运行MSYS2 这是一个shell会话的副本。[…]中的行是以后添加的注释 $ ./flmoon.exe Date of the next few phases of the moon Enter today's date (e.g. 1,31,1982) [program running OK - aborted with Ctrl-C] $ cp flmoon.exe flmoon2.exe [copy to a different

我在Windows10Professional下运行MSYS2

这是一个shell会话的副本。[…]中的行是以后添加的注释

$ ./flmoon.exe
 Date of the next few phases of the moon
 Enter today's date (e.g. 1,31,1982)

[program running OK - aborted with Ctrl-C]

$ cp flmoon.exe flmoon2.exe

[copy to a different name]

$ ./flmoon2.exe
 Date of the next few phases of the moon
 Enter today's date (e.g. 1,31,1982)

[the copy also runs OK - aborted]

$ cp flmoon2.exe xflmoon.exe

[copy to a another different name]

$ ./xflmoon.exe
bash: ./xflmoon.exe: Permission denied

[HUH????]

$ ls -l flmoon.exe flmoon2.exe xflmoon.exe
-rwxr-xr-x 1 Rob None 409191 May  9 01:14 flmoon.exe
-rwxr-xr-x 1 Rob None 409191 May  9 01:26 flmoon2.exe
-rwxr-xr-x 1 Rob None 409191 May  9 01:27 xflmoon.exe

[But all three files have the same permissions???]
“xflmoon.exe”这个名字有什么“魔力”吗

FWIW,在Windows shell下运行xflmoon.exe首先会给出一条Windows用户访问控制消息,如果我接受这一点,程序就会在一个单独的控制台窗口中运行,这不是我想要的。其他两个文件名按预期在Windows下作为命令行应用程序运行

FWIW可执行文件是使用gfortran构建的:

$ gfortran -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gfortran.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-6.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 6.2.0 (Rev2, Built by MSYS2 project)
使用Cygwin而不是MSYS2以及相同的文件名也会出现相同的行为

注意,原始源代码来自NumericalRecipes库和附带的示例书

更新:

作为对注释的响应,xflmoon.exe已被Windows标记为“以管理员身份运行”,但其他两个.exe文件尚未标记。如果删除该标志,它将按预期运行


所以现在的问题变成了“为什么Windows要标记它,它会影响其他哪些文件名,我如何才能阻止它这样做?”

/xflmoon.exe
您在该目录中有执行权限吗?@BagusTesa我可以在同一目录中执行其他两个可执行文件。啊,对了,您已经发布了权限。您是否已通过windows资源管理器检查其文件属性?我想知道windows是否为它做了标记。@BagusTesa啊。。。windows已将其标记为“以管理员身份运行”。但为什么它会这样做?我想知道。。在使用Cygwin时,千万不要碰到类似的事情。