“X 不是内部或外部命令、可运行的程序或批处理文件"的原因是什么? [英] What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?
问题描述
我有一个在命令行中完美运行的单行代码段,但是当我将它作为批处理脚本的一部分运行时失败并抛出错误.
I have a one-line snippet that works perfectly in the command line, but fails and throws up errors when I run it as part of a batch script.
以下命令按预期运行,删除文件夹中的所有空子文件夹.
The below commands behaves as expected, deleting all empty subfolders in the folder.
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do rd "%d"
但是,当像这样放入批处理文件时......
However, when put in a batch file like so...
FOR /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do rd "%%d"
...它抛出标准错误:
...it throws the standard error:
Sort 未被识别为内部或外部命令
Sort is not recognised as an internal or external command
在过去的一个小时左右,我一直在尝试是否逃逸管道,更改选项的顺序,查找 dir
和 sort
的文档> 等,但我仍然无法弄清楚这里发生了什么.批处理文件的其余部分(只有几行)工作正常,这是其中唯一失败的行.
I've been experimenting for the last hour or so with and without escaping the pipe, changing the order of the options, looking up the documentation of both dir
and sort
, etc., but I've still not been able to figure out what's going on here. The rest of the batch file, which is only a few lines, works fine, and this is the only line in it that fails.
有人可以帮忙吗?
推荐答案
A) Windows 命令处理器如何搜索命令?
Windows 命令处理器搜索 COMMAND 来执行哪个
- 不是
cmd.exe
和 的内部命令 - 只是指定了文件名,没有文件扩展名,没有路径
对于与模式匹配的文件 command.*
和 具有在本地环境变量 PATHEXT
中列出的文件扩展名
for a file matching the pattern command.*
and having a file extension listed in local environment variable PATHEXT
- 当前目录中的第一个和
- next 在本地环境变量
PATH
的所有目录中.
- first in current directory and
- next in all directories of local environment variable
PATH
.
SORT 和 FIND 和 FINDSTR 和 ROBOCOPY 和 XCOPY 等等命令不是 cmd.exe
的内部命令.它们是与 Windows 一起安装的控制台应用程序,位于目录 %SystemRoot%System32
中,文件名为 sort.exe
, find.exe
, >findstr.exe
、robocopy.exe
、xcopy.exe
、...
SORT and FIND and FINDSTR and ROBOCOPY and XCOPY and many more commands are not internal commands of cmd.exe
. They are console applications installed with Windows located in directory %SystemRoot%System32
having the file name sort.exe
, find.exe
, findstr.exe
, robocopy.exe
, xcopy.exe
, ...
Windows 上默认可用的此类控制台应用程序称为外部命令,以更好地将它们与未安装 Windows 操作系统的控制台应用程序区分开来.
Such console applications available by default on Windows are called external commands to distinguish them better from console applications not installed with Windows operating system.
PATH
变量有 3 种类型:
There are 3 types of PATH
variables:
System
PATH
用于所有帐户并存储在 Windows 注册表中的密钥:
System
PATH
which is used for all accounts and stored in Windows registry under key:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerEnvironment
User PATH
仅用于当前帐户并存储在 Windows 注册表项下:
User PATH
which is used only for current account and stored in Windows registry under key:
HKEY_CURRENT_USEREnvironment
Local PATH
始终是启动的父进程的本地 PATH
的副本当前进程.
Local PATH
which is always a copy of the local PATH
of parent process which started the current process.
Windows 将 system 和 user PATH
连接到 local PATH
用于 Windows资源管理器实例用作 Windows 桌面,桌面屏幕上的快捷方式和 Windows 开始菜单作为用户的可见界面.
Windows concatenates system and user PATH
to local PATH
for the Windows Explorer instance used as Windows desktop with the shortcuts on desktop screen and the Windows start menu as visible interface for the user.
在启动新进程时,Windows 会为新进程复制正在运行的进程的整个当前活动环境变量表.
On starting a new process the entire currently active environment variables table of running process is copied for the new process by Windows.
父进程不能修改任何子进程的环境变量,子进程也不能修改其父进程的环境变量.
The parent process cannot modify the environment variables of any child process nor can a child process modify the environment variables of its parent process.
这意味着一旦像 cmd.exe
这样的进程被启动以执行批处理文件,该进程就有自己的一组环境变量,只有进程本身可以修改这些变量.没有其他进程可以修改已运行进程的环境变量.
This means once a process like cmd.exe
was started for execution of a batch file, the process has its own set of environment variables which only the process itself can modify. No other process can modify the environment variables of an already running process.
错误信息
'...' 不是内部或外部命令,
可运行的程序或批处理文件.
'...' is not recognized as an internal or external command,
operable program or batch file.
总是意味着
一个文件名
the file name of a
- 控制台应用程序
- 图形用户界面应用
- 脚本(批处理文件、PowerShell 脚本、Perl 脚本、VBScript、JScript 等)
被指定执行很可能没有文件扩展名和可执行文件/脚本文件的(完整)路径和
Windows 未能在当前目录或任何其他目录中找到与模式 FileName.*
匹配且文件扩展名列在当前活动环境变量 PATHEXT
中的文件在当前活动的环境变量 PATH
中.
Windows failed to find a file matching the pattern FileName.*
with a file extension listed in currently active environment variable PATHEXT
in current directory or any other directory in currently active environment variable PATH
.
D) 出现此错误消息的可能原因是什么?
典型原因是:
1.由于输入错误,要执行的文件的文件名指定错误.
逐字符检查命令/可执行文件的名称.
Check character by character the name of the command/executable.
2.当前目录与包含要执行的文件的目录不同.
在命令行上运行 echo Current directory is: %CD%
或将此行添加到无法查看当前目录是什么的命令行上方的批处理文件中.
Run echo Current directory is: %CD%
on command line or add this line to the batch file above the command line which fails to see what the current directory is.
3.根本没有安装要运行的可执行文件或脚本.
验证要运行的可执行文件是否存在.某些安装包只有在之前安装了其他包(如 Java、NPM、PHP 等)时才有效.
Verify the existence of the executable to run. Some installation packages work only if other packages like Java, NPM, PHP, etc. were installed before.
4.要执行的文件的目录不在 PATH
中.
在Windows控制面板中打开系统设置窗口,点击左侧的高级系统设置,点击环境按钮变量,并在两个列表中查找 Path
及其值.默认情况下,Path
只存在于系统变量列表中.
Open in Windows Control Panel the System settings window, click on Advanced system settings on left side, click on button Environment Variables and look in both lists for Path
and their values. By default Path
exists only in list of System variables.
5.修改系统或用户后未重新启动正在运行的进程/应用程序 PATH
.
使用 setx
命令修改 system PATH
或 user PATH
或通过控制面板 – 系统 – 高级系统设置 由用户或安装程序进行,但已经运行的进程/应用程序(如打开的命令提示符或 PowerShell 窗口)在此之后未关闭/退出和打开/重新启动PATH
修改.正如下面F) 章中详细描述的那样,这是必要的.
A modification of system PATH
or user PATH
with command setx
or via Control Panel – System – Advanced system settings was made by the user or an installer, but an already running process/application like an opened command prompt or PowerShell window was not closed/exited and opened/restarted after PATH
modification. This is necessary as described in detail in chapter F) below.
6.在 64 位 Windows 上找不到 %SystemRoot%System32
中的可执行文件.
6. An executable in %SystemRoot%System32
is not found on 64-bit Windows.
目录 %SystemRoot%System32
包含 64 位可执行文件,%SystemRoot%SysWOW64
包含 64 位 Windows 上的 32 位可执行文件.大多数可执行文件都存在于这两个目录中.但是有一些可执行文件只存在于 System32
和一些只存在于 SysWOW64
中.
There is the directory %SystemRoot%System32
with 64-bit executables and %SystemRoot%SysWOW64
with 32-bit executables on 64-bit Windows. Most executables exist in both directories. But there are some executables existing only in System32
and a few only in SysWOW64
.
system PATH
默认包含第一个文件夹路径 %SystemRoot%System32
.但是在两个 Windows 系统文件夹中的哪一个中搜索指定的没有路径或路径 %SystemRoot%System32
的可执行文件取决于执行环境.在 64 位环境中执行的应用程序或脚本实际上是访问 %SystemRoot%System32
而在 32 位环境中执行的应用程序或脚本由 Windows 文件系统重定向器 到目录 %SystemRoot%SysWOW64
.
The system PATH
contains by default as first folder path %SystemRoot%System32
. But which one of the two Windows system folders is searched for the executable specified without path or with the path %SystemRoot%System32
depends on the execution environment. An application or script executed in 64-bit environment is really accessing %SystemRoot%System32
while an application or script executed in 32-bit environment is redirected by the Windows file system redirector to the directory %SystemRoot%SysWOW64
.
在 32 位环境中运行的应用程序或脚本想要在 %SystemRoot%System32
中运行 64 位可执行文件必须使用可执行文件的完整限定文件名和文件路径 %SystemRoot%Sysnative
.
An application or script running in 32-bit environment which wants to run a 64-bit executable in %SystemRoot%System32
has to use full qualified file name of the executable with file path %SystemRoot%Sysnative
.
注意: %SystemRoot%Sysnative
既不是目录也不是任何类型的链接.这是一种非常特殊的东西,只存在于 x86 应用程序中.amd64 应用程序不存在它.批处理文件中的条件 if exists %SystemRoot%Sysnative
在两种环境中始终为 false,但 ifexist %SystemRoot%Sysnativecmd.exe
在 32 中为 true-bit 执行环境和 false 在 64 位环境和 32 位 Windows 上也是如此.此条件可用于批处理脚本中,以查明批处理文件是否由 64 位 Windows 上的 %SystemRoot%SysWOW64
中的 32 位 cmd.exe
处理,其中根据任务,了解可能很重要.
Note: %SystemRoot%Sysnative
is neither a directory nor any type of link. It is something very special existing only for x86 applications. It does not exist for amd64 applications. The condition if exist %SystemRoot%Sysnative
in a batch file is always false in both environments, but if exist %SystemRoot%Sysnativecmd.exe
is true in 32-bit execution environment and false in 64-bit environment and also on 32-bit Windows. This condition can be used in batch scripts to find out if the batch file is processed by 32-bit cmd.exe
in %SystemRoot%SysWOW64
on 64-bit Windows which can be important to know depending on the task.
另请参阅 Microsoft 文档WOW64 实施详情 和 受 WOW64 影响的注册表项.
See also the Microsoft documentations WOW64 Implementation Details and Registry Keys Affected by WOW64.
7. PATH
包含对(尚未)定义的环境变量的引用.
可以在PATH
中使用对另一个环境变量(如SystemRoot
)值的引用来指定文件夹路径.重要的是,此环境变量也在同一组环境变量或 Windows 首先处理的一组环境变量中定义.
It is possible to specify in PATH
a folder path using a reference to value of another environment variable like SystemRoot
. It is important that this environment variable is also defined in same set of environment variables or a set of environment variables processed first by Windows.
例如,如果将%JAVA_HOME%in
添加到system PATH
环境变量中,则还必须定义一个system 环境变量 JAVA_HOME
和 Java 程序文件的基本文件夹路径.定义一个用户环境变量JAVA_HOME
或稍后在local中定义环境变量JAVA_HOME
是不够的批处理文件的环境.
For example if %JAVA_HOME%in
is added to system PATH
environment variable, there must be defined also a system environment variable JAVA_HOME
with the base folder path to Java program files. It is not enough to have defined a user environment variable JAVA_HOME
or define the environment variable JAVA_HOME
later in the local environment of a batch file.
%JAVA_HOME%in
添加到 user PATH
由 Windows 扩展为完全限定的文件夹路径,如果环境变量 JAVA_HOME
被定义为系统 或用户 环境变量,但不是在本地 Windows 命令进程的环境.
%JAVA_HOME%in
added to user PATH
is expanded by Windows to a full qualified folder path if the environment variable JAVA_HOME
is defined either as system or as user environment variable, but not on JAVA_HOME
defined later in the local environment of a Windows command process.
在对system 或 user PATH
从 Windows 开始菜单并运行 set path
.输出 PATH
不应再包含任何 %Variable%
环境变量值引用.
Such a mistake can be seen easily by opening a new command prompt window after making a modification on system or user PATH
from Windows start menu and running set path
. The output PATH
should not contain anymore any %Variable%
environment variable value reference.
8.LOCAL 变量 PATH
之前在命令行或批处理文件中被修改过.
在命令行上运行set path
或将此命令添加到命令行上方的批处理文件中,无法看到环境变量PATH
和的当前值>PATHEXT
.
Run set path
on command line or add this command to the batch file above the command line which fails to see the current values of the environment variables PATH
and PATHEXT
.
最后一个原因是外部命令 SORT 在执行包含 set path=...
以上某处的批处理文件时找不到.
The last reason is responsible for external command SORT not being found on execution of the batch file which contains somewhere above set path=...
.
最好是编写一个独立于 PATH
和 PATHEXT
以及 PATH
中的目录顺序的批处理文件,这意味着这里使用命令行:
Best is coding a batch file for being independent on PATH
and PATHEXT
and the order of directories in PATH
which means here using the command line:
FOR /f "delims=" %%d in ('dir /s /b /ad ^| %SystemRoot%System32sort.exe /r') do rd "%%d"
任何外部命令,其可执行文件存储在%SystemRoot%System32
中,应在批处理文件中指定此路径和文件扩展名.exe代码>.然后 Windows 命令解释器不需要使用 local
PATH
和 PATHEXT
搜索文件并且批处理文件始终有效(只要环境变量SystemRoot
在我从未见过的批处理文件中也没有被修改).
Any external command of which executable is stored in %SystemRoot%System32
should be specified in a batch file with this path and with file extension .exe
. Then Windows command interpreter does not need to search for a file using local PATH
and PATHEXT
and the batch file works always (as long as environment variable SystemRoot
is not also modified in the batch file which I have never seen).
当用户通过 Windows 开始菜单或从 Windows 资源管理器窗口中打开命令提示窗口时,用户会使用隐式使用选项 /K
启动 cmd.exe
完成一个有利于调试批处理文件的命令后,保持控制台窗口打开.
When a user opens a command prompt window via Windows start menu or from within a Windows Explorer window, the user starts cmd.exe
with implicit using option /K
to keep the console window open after finishing a command which is good for debugging a batch file.
当在 Windows 资源管理器中双击批处理文件时,用户启动 cmd.exe
处理批处理文件,隐式使用选项 /C
关闭控制台窗口完成批处理后,不利于调试批处理文件,因为在这种情况下无法看到错误消息.
When a batch file is doubled clicked in Windows Explorer, the user starts cmd.exe
for processing the batch file with implicit using option /C
to close the console window after finishing batch processing which is not good for debugging a batch file as error messages cannot be seen in this case.
在这两种情况下,Windows 都会创建启动 cmd.exe
(通常是 Windows 资源管理器)的应用程序的环境变量的副本.因此,启动的命令进程有一个 local PATH
,其值与父进程在启动 cmd.exe
时的值相同.
In both cases Windows creates a copy of the environment variables of the application starting cmd.exe
which is usually Windows Explorer. Therefore the started command process has a local PATH
of which value is the same as the parent process had on starting cmd.exe
.
示例:
打开命令提示符窗口,运行
title Process1
并运行set path
.
输出是PATH
和PATHEXT
为当前在控制台窗口中为当前用户帐户定义的,现在窗口标题为 Process1.
Open a command prompt window, run
title Process1
and runset path
.
Output isPATH
andPATHEXT
as currently defined for current user account in the console window having now the window title Process1.
运行set PATH=%SystemRoot%System32
,然后再次set path
.
输出再次是 PATH
和 PATHEXT
,但 PATH
现在只包含一个目录.
Run set PATH=%SystemRoot%System32
and next once again set path
.
Output is again PATH
and PATHEXT
, but with PATH
containing only one directory now.
运行 start Process2"
并在带有窗口标题 Process2 命令 set path
的新控制台窗口中运行.
输出是 PATH
和 PATHEXT
,其值与 Process1 中的值相同.
这表明在启动新进程时,将复制正在运行的进程的当前环境变量,而不是 Windows 本身当前存储在 Windows 注册表中的内容.
Run start "Process2"
and run in new console window with window title Process2 the command set path
.
Output is PATH
and PATHEXT
with same values as before in Process1.
This demonstrates that on starting a new process the current environment variables of running process are copied and not what Windows itself has currently stored in Windows registry.
在 Process2 中运行命令 set PATH=
和下一个 set path
.
输出仅为 PATHEXT
,因为 local PATH
对于 Process2 不再存在.
这表明每个进程都可以修改其环境变量,包括完全删除.
Run in Process2 the command set PATH=
and next set path
.
Output is only PATHEXT
because local PATH
does not exist anymore for Process2.
This demonstrates that every process can modify its environment variables including complete deletion.
切换到 Process1 窗口,运行命令 set PATH=%PATH%;%SystemRoot%
和下一个 set path
.
输出是带有两个目录的 PATH
和 PATHEXT
.
Switch to Process1 window, run the command set PATH=%PATH%;%SystemRoot%
and next set path
.
Output is PATH
with two directories and PATHEXT
.
运行命令 start Process3"
并在标题为 Process3 的打开窗口中运行命令 set path
.
输出是 PATH
,其中有两个目录,也为 Process1 和 PATHEXT
定义.
Run the command start "Process3"
and in opened window with title Process3 the command set path
.
Output is PATH
with two directories as defined also for Process1 and PATHEXT
.
在 Process3 中运行命令 set PATH=%SystemRoot%System32
.
当 %SystemRoot%
扩展到 C:Windows<时,有 3 个命令进程运行,local
PATH
的值如下/代码>:
There are 3 command processes running with following values for local PATH
when %SystemRoot%
expands to C:Windows
:
Process1:PATH=C:WindowsSystem32;C:Windows
Process2:PATH
根本不存在.
Process3:PATH=C:WindowsSystem32
那么现在打开控制面板 - 系统 - 高级系统设置 - 环境变量 并添加到用户变量列表中会发生什么新的环境变量 PATH
值为 C:Temp
,或者如果已经有 user PATH
环境变量, edit PATH
并将 ;C:Temp
附加到值?
So what happens now on opening Control Panel – System – Advanced System Settings – Environment Variables and adding to list of User variables the new environment variable PATH
with value C:Temp
, or in case of there is already a user PATH
environment variable, edit PATH
and append ;C:Temp
to the value?
好吧,只要打开显示两个列表的标题为环境变量的对话框窗口,修改变量没有任何反应,直到单击按钮确定关闭对 Windows 注册表的所有更改并关闭窗口.
Well, as long as the dialog window with title Environment Variables showing the two lists is opened, nothing happens on modifying the variables, until button OK is clicked to take over all changes into Windows registry and close the window.
我们回到三个正在运行的命令进程,分别在Process1、Process2和Process3运行命令set path代码>.可见:
Let's go back to the three running command processes and run in Process1, Process2 and Process3 the command set path
. It can be seen:
Process1:PATH=C:WindowsSystem32;C:Windows
Process2:PATH
根本不存在.
Process3:PATH=C:WindowsSystem32
已经运行的进程没有任何变化.
Nothing changed on already running processes.
任何进程都不能修改不同运行进程的环境变量!
从 Windows 开始菜单再打开一个命令提示符窗口,然后在第四个命令处理命令 set path
中运行.可以看出,第四个命令进程的local PATH
现在已经追加了C:Temp
目录.
Open from Windows start menu one more command prompt window and run in fourth command process the command set path
. It can be seen that local PATH
of fourth command process has appended the directory C:Temp
now.
然后关闭所有四个命令进程并删除添加的user PATH
分别从user删除;C:Temp
strong> PATH
如果之前附加过这个目录路径.
Then close all four command processes and delete the added user PATH
respectively remove ;C:Temp
from user PATH
if having appended this directory path before.
如果没有进程可以修改已运行进程的环境变量,这怎么可能?
How is this possible if no process can modify the environment variables of an already running process?
在使用确定按钮关闭环境变量窗口时,作为Windows桌面运行的Windows资源管理器实例的环境变量列表如何修改?
How was the environment variables list of Windows Explorer instance running as Windows desktop modified on closing Environment Variables window with button OK?
eryksun 在他的评论中给出了关于这两个问题的答案.
The answer on those two questions was given by eryksun in his comment.
在点击环境变量窗口的确定按钮将系统和用户变量的修改写入注册表后,Windows 将 WM_SETTINGCHANGE 消息发送到所有顶级windows 通知正在运行的应用程序有关更改的系统参数.
After writing the modifications on system and user variables into registry on clicking button OK of Environment Variables window, Windows sends the WM_SETTINGCHANGE message to all top-level windows to inform the running applications about changed system parameters.
是否完全处理此事件消息以及如何处理取决于应用程序.作为 Windows 桌面运行的 Windows 资源管理器从注册表中读取环境变量并相应地更新其环境变量列表.Total Commander 等其他应用程序也会处理此消息并更新它们的环境变量列表.但幸运的是 cmd.exe
并没有这样做,因为这真的很成问题.
It is up to the application if this event message is handled at all and how. Windows Explorer running as Windows desktop reads the environment variables from registry and updates its environment variables list accordingly. Other applications like Total Commander handle this message also and update their lists of environment variables too. But cmd.exe
does not do that fortunately as this would be really problematic.
是否有可能在命令提示符窗口或批处理文件中通过 WM_SETTINGCHANGE
通知修改系统或用户变量?
Is there any possibility to modify a system or user variable with notification via WM_SETTINGCHANGE
from within a command prompt window or batch file?
可以使用 reg add
命令修改环境变量的注册表值.但这不会导致向所有顶级窗口发送 WM_SETTINGCHANGE
消息.使用 reg add
或 regedit
完成的此类更改需要重新启动 Windows(或至少注销并登录当前用户)才能完全考虑在内.
It is possible to modify the registry value of an environment variable using reg add
command. But this does not result in sending WM_SETTINGCHANGE
message to all top-level windows. Such changes done with reg add
or with regedit
require a restart of Windows (or at least a log off and log on of current user) to be taken into account at all.
但是还有命令 setx
设计用于修改 system 或 user 变量,它还发送 WM_SETTINGCHANGE
根据指定的参数更新注册表后所有顶级窗口的消息.在命令提示符窗口中运行 setx/?
以获取详细信息.但请注意 setx
不会修改运行命令进程的 local 环境变量.这必须通过使用命令 set
和 setx
一起使用来完成.
But there is also the command setx
which is designed for modifying a system or user variable and which also sends the WM_SETTINGCHANGE
message to all top-level windows after registry was updated according to specified arguments. Run setx /?
in a command prompt window for details. But please take into account that setx
does not modify the local environment variable of running command process. This must be done with using command set
used in addition to setx
.
与环境变量 PATH
相比,带有文件扩展名列表的环境变量 PATHEXT
由 Windows 处理.
The environment variable PATHEXT
with the list of file extensions is handled by Windows different in comparison to environment variable PATH
.
System PATHEXT
和 user PATHEXT
NOT 连接到 本地 PATHEXT
.
System PATHEXT
and user PATHEXT
are NOT concatenated to local PATHEXT
.
用户 PATHEXT
替换 系统 PATHEXT
用于在其下运行的所有进程已定义用户 PATHEXT
的帐户环境.
A user PATHEXT
replaces the system PATHEXT
for all processes running under environment of the account having defined a user PATHEXT
.
默认只定义了一个系统 PATHEXT
环境变量.
There is defined only a system PATHEXT
environment variable by default.
Windows 命令处理器默认在当前目录中搜索,如果脚本文件或可执行文件的文件名在命令行或批处理文件中指定,没有任何路径,这意味着没有反斜杠 (或正斜杠
/
由于自动更正)在参数字符串中.
Windows command processor searches by default in current directory if file name of a script file or executable is specified on command line or in a batch file without any path which means without a backslash (or a forward slash
/
thanks to auto-correction) in argument string.
但是在 Windows Vista 和更高版本的 Windows 客户端版本上以及在 Windows Server 2003 和更高版本的 Windows 服务器版本上,确实可以禁用在没有至少相对路径 .
的情况下指定的当前目录中搜索脚本/可执行文件code> 通过定义环境变量 NoDefaultCurrentDirectoryInExePath
和 eryksun 在下面的评论中所写的任何值并由微软关于函数的文档解释 NeedCurrentDirectoryForExePathA.
But on Windows Vista and later Windows client versions and on Windows Server 2003 and later Windows server versions it is indeed possible to disable searching for a script/executable in current directory specified without at least relative path .
by defining the environment variable NoDefaultCurrentDirectoryInExePath
with any value as written by eryksun in his comment below and explained by Microsoft's documentation about function NeedCurrentDirectoryForExePathA.
请参阅从路径中删除当前工作目录,了解有关此环境变量用法的更多详细信息.
See Removing the current working directory from the path for more details on usage of this environment variable.
这篇关于“X 不是内部或外部命令、可运行的程序或批处理文件"的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!