前缀PATH,现在cmd和帮助不是可操作的命令

时间:2012-09-16 21:52:52

标签: batch-file cmd

场景:我找到了令人敬畏的Console2 http://sourceforge.net/projects/console/并开始为它制作三个环境:Cygwin,原始Windows和GnuWin32。前两个工作正常,但第三个工作非常困难。

我在我的用户目录中将此文件保存为cmdrc.bat,并告诉控制台它是我的GnuWin32选项卡的shell。

set PATH="C:\gnuwin32\bin;C:\gnuwin32\include\glibc;%PATH%"
echo %PATH%
cmd
help
ls

打开命令提示符并粘贴该代码(因此窗口不会消失),我得到:

C:\Users\Chris>set PATH="C:\gnuwin32\bin;C:\gnuwin32\include\glibc;%PATH%"

C:\Users\Chris>echo %PATH%
"C:\gnuwin32\bin;C:\gnuwin32\include\glibc;[all the correct stuff that was there before]"

C:\Users\Chris>cmd
'cmd' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Chris>help
'help' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Chris>ls // GnuWin32 isn't available, either.
'ls' is not recognized as an internal or external command,
operable program or batch file.

我的set语法无效,或者是什么?

1 个答案:

答案 0 :(得分:1)

PATH定义中删除双引号。

set PATH=C:\gnuwin32\bin;C:\gnuwin32\include\glibc;%PATH%