1. <i id='ffWDC'><tr id='ffWDC'><dt id='ffWDC'><q id='ffWDC'><span id='ffWDC'><b id='ffWDC'><form id='ffWDC'><ins id='ffWDC'></ins><ul id='ffWDC'></ul><sub id='ffWDC'></sub></form><legend id='ffWDC'></legend><bdo id='ffWDC'><pre id='ffWDC'><center id='ffWDC'></center></pre></bdo></b><th id='ffWDC'></th></span></q></dt></tr></i><div id='ffWDC'><tfoot id='ffWDC'></tfoot><dl id='ffWDC'><fieldset id='ffWDC'></fieldset></dl></div>
    • <bdo id='ffWDC'></bdo><ul id='ffWDC'></ul>

    <small id='ffWDC'></small><noframes id='ffWDC'>

    <legend id='ffWDC'><style id='ffWDC'><dir id='ffWDC'><q id='ffWDC'></q></dir></style></legend>
    1. <tfoot id='ffWDC'></tfoot>
    2. Windows CMD.exe“系统找不到指定的路径."

      时间:2023-09-25
      <tfoot id='SbAJA'></tfoot>
    3. <legend id='SbAJA'><style id='SbAJA'><dir id='SbAJA'><q id='SbAJA'></q></dir></style></legend>
        <tbody id='SbAJA'></tbody>
        <i id='SbAJA'><tr id='SbAJA'><dt id='SbAJA'><q id='SbAJA'><span id='SbAJA'><b id='SbAJA'><form id='SbAJA'><ins id='SbAJA'></ins><ul id='SbAJA'></ul><sub id='SbAJA'></sub></form><legend id='SbAJA'></legend><bdo id='SbAJA'><pre id='SbAJA'><center id='SbAJA'></center></pre></bdo></b><th id='SbAJA'></th></span></q></dt></tr></i><div id='SbAJA'><tfoot id='SbAJA'></tfoot><dl id='SbAJA'><fieldset id='SbAJA'></fieldset></dl></div>

            <bdo id='SbAJA'></bdo><ul id='SbAJA'></ul>

                <small id='SbAJA'></small><noframes id='SbAJA'>

                本文介绍了Windows CMD.exe“系统找不到指定的路径."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                1) 当我打开新的 CMD (Win+R => cmd) 时.它从介绍开始.(在第 3 行)

                1) When i open new CMD (Win+R => cmd). It starts with introduction. (on line 3)

                Microsoft Windows [Version 6.1.7601]
                Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
                The system cannot find the path specified.
                
                C:UsersViliamKopecky>
                

                2) 当我执行一些命令时,例如 cmd/C dir(或 cmd/C php -v 或其他)(第 2 行)

                2) When i execute some command like cmd /C dir (or cmd /C php -v or whatever) (on line 2)

                C:UsersViliamKopecky>cmd /C dir
                The system cannot find the path specified.
                 Volume in drive C is Windows7_OS
                 Volume Serial Number is 8230-1246
                ...
                
                C:WindowsSystem32>cmd /C php -v
                The system cannot find the path specified.
                PHP 5.4.8 (cli) (built: Oct 16 2012 22:30:23)
                Copyright (c) 1997-2012 The PHP Group
                Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
                

                3)(最烦人的)当我从 PHP 或 Node.js 或任何脚本语言运行 exec 函数时.(可能是从内部运行的 cmd/C )

                3) (the most annoying) when i run exec function from PHP or Node.js or probably any scripting lang. (which are probably runned from inside as cmd /C <command>)

                1) 当我直接从 cmd(或 mingw,...)执行命令时

                1) when i execute the command right from the cmd (or mingw, ...)

                C:UsersViliamKopecky>dir
                 Volume in drive C is Windows7_OS
                 Volume Serial Number is 8230-1246
                
                 Directory of C:UsersViliamKopecky
                

                <小时>

                让我们从 cmd 中的简单命令开始.


                Let's start with simple command from cmd.

                php -r "exec('dir', $stdout, $stderr); print(implode(" ", $stdout), $stderr);"

                php -r "exec('dir', $stdout, $stderr); print(implode(" ", $stdout), $stderr);"

                结果是这样的(目录测试是空的 - 这是正确的):

                E:	est>php -r "exec('dir', $stdout, $stderr); print(implode("
                ", $stdout), $stderr);"
                The system cannot find the path specified.
                 Volume in drive E is www
                 Volume Serial Number is 0C99-95EC
                
                 Directory of E:	est
                
                09.11.2012  22:42    <DIR>          .
                09.11.2012  22:42    <DIR>          ..
                               0 File(s)              0 bytes
                               2 Dir(s)  13 495 296 000 bytes free
                int(1)
                

                这表明命令 dir 已从 php 正确执行.唯一错误的是第二行 - 系统找不到指定的路径. - 不应该在那里.

                Which shows that the command dir has is executed from php correctly. Only thing thats wrong is the second line - The system cannot find the path specified. - that should not be there.

                此消息由 PHP 的 exec 输出(也来自 Node.js 作为 require('child_process').exec("dir", function(err, stdout, stderr) {console.log(stderr)});)

                This message is output by exec from PHP (and also from Node.js as require('child_process').exec("dir", function(err, stdout, stderr) {console.log(stderr)});)

                当我直接从 cmd(或 mingw 等)执行命令时,它会正确执行而没有消息.环境变量 PATH 似乎没问题.问题只是通过 exec 函数从脚本环境执行.

                When I execute command right from cmd (or mingw, etc.) it executes correctly without the message. Environment variable PATH seem ok. Problem is just executing from script environment through exec functions.

                如何摆脱烦人的信息?谢谢

                推荐答案

                问题是某些程序已设置为在您运行 cmd.exe 时自动运行.就我而言,安装的是 ANSICON...然后我在没有正确卸载的情况下移动了文件.

                The problem is that some program has been set to autorun when you run cmd.exe. In my case it was ANSICON that was installed... and then I moved the file without properly uninstalling.

                我在这篇博文中找到了解决方案:

                I found a solution in this blog post:

                http://carol-nichols.com/2011/03/17/the-system-cannot-find-the-path-specified/

                短版就是找

                HKCUSoftwareMicrosoftCommand ProcessorAutoRun

                HKCUSoftwareMicrosoftCommand ProcessorAutoRun

                并清除该值.

                这篇关于Windows CMD.exe“系统找不到指定的路径."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:对 PHP 的 Windows 命令行输出进行着色 下一篇:PHP UTF-8 转 Windows 命令行编码

                相关文章

                最新文章

                <tfoot id='hCQAR'></tfoot>
              1. <i id='hCQAR'><tr id='hCQAR'><dt id='hCQAR'><q id='hCQAR'><span id='hCQAR'><b id='hCQAR'><form id='hCQAR'><ins id='hCQAR'></ins><ul id='hCQAR'></ul><sub id='hCQAR'></sub></form><legend id='hCQAR'></legend><bdo id='hCQAR'><pre id='hCQAR'><center id='hCQAR'></center></pre></bdo></b><th id='hCQAR'></th></span></q></dt></tr></i><div id='hCQAR'><tfoot id='hCQAR'></tfoot><dl id='hCQAR'><fieldset id='hCQAR'></fieldset></dl></div>
                <legend id='hCQAR'><style id='hCQAR'><dir id='hCQAR'><q id='hCQAR'></q></dir></style></legend>

                <small id='hCQAR'></small><noframes id='hCQAR'>

                    • <bdo id='hCQAR'></bdo><ul id='hCQAR'></ul>