代码页850工作,65001失败!没有对“call foo.cmd”的响应。内部命令工作正常 [英] Codepage 850 works, 65001 fails! There is NO response to "call foo.cmd". internal commands work fine

查看:413
本文介绍了代码页850工作,65001失败!没有对“call foo.cmd”的响应。内部命令工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题基本上解释了这个问题。

The question basically explains the problem.

我使用的是Windows XP Pro Service Pack 3

ComSpec = C:\WINDOWS\\ \\ sysystem32 \cmd.exe

我通过开始...运行对话框... cmd.exe启动控制台

I'm using Windows XP Pro Service Pack 3
ComSpec=C:\WINDOWS\system32\cmd.exe
I launched the console via Start... Run-dialog... cmd.exe

这里是一个我的控制台的视图:

命令,然后输出(和我的//注释)

Here is a "view" of my console:
The command, then the output (and my // comments)

C:\> chcp 850
Active code page: 850
// output is as expected

C:\> echo @chcp ^& REM 850>test850.cmd
// no output; as ecpected)

C:\> type test850.cmd
@chcp & REM 850
// output is as expected

C:\> call test850.cmd
Active code page: 850
// output is as expected

上面的工作正常(如预期)。
在Windows-land,
中的事情很开心,但是当我切换到代码页65001时,callFAILS

The above works fine (as expected). Things are happy in Windows-land, but the "call" FAILS when I switch to codepage 65001

C:\> chcp 65001
Active code page: 65001
// output is as expected

C:\> echo @chcp ^& REM 65001>test65001.cmd
// no output; as ecpected

C:\> type test65001.cmd
@chcp & REM 65001
// output is as expected

C:\> call test65001.cmd
// NO OUTPUT, NO ERROR, NO ANYTHING, NADA... other than frustration :)

这里发生了什么(不会发生)?

What is happening (NOT happening) here?

推荐答案

有趣的是, 。如果您执行以下操作:

Interesting, it's not actually running it at all. If you do the following:

pax> echo echo yy >xx.cmd
pax> chcp 850
pax> xx
yy
pax> chcp 65001
pax> xx
pax> _

你会得到没有。它不仅仅是缺少输出,它根本不运行(通过在 echo 行之前插入 可以证明)。在代码页850中,Explorer运行,但代码页65001不是这样。

you get nothing. It's not just missing output, it's not running at all (as evidenced by putting start . before the echo line). In code page 850, Explorer runs, not so for code page 65001.

通过此处。您可以让脚本运行:

There's some discussion on the issue over here. You can get your script to run with:

chcp 65001 && xx.cmd && chcp 850

所以似乎是在启动命令文件的某种问题,但只有当代码页

so it seems to be some sort of problem in starting command files but only when the code page is 65001 before you enter the command!

在网络上的其他人似乎建议PowerShell可能是一个不错的选择,考虑到 cmd.exe 。这是一个决定,你必须自己评估,但是,在一个大型组织自己工作,许多工具做同样的工作,我怀疑微软将放置任何增强的工作背后的PowerShell,而不是旧的命令shell。他们的资源很大,但不是无限的。

Others on the net seem to be suggesting that PowerShell may be a good choice, given the finicky support in cmd.exe. That's a decision you'll have to evaluate for yourself but, working in a large organisation myself with many tools to do the same job, I suspect Microsoft will be placing any enhancement efforts behind PowerShell rather the older command shell. Their resources are large but not unlimited.

这篇关于代码页850工作,65001失败!没有对“call foo.cmd”的响应。内部命令工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆