Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何查找路径上的exe的目录_Windows_Cmd - Fatal编程技术网

Windows 如何查找路径上的exe的目录

Windows 如何查找路径上的exe的目录,windows,cmd,Windows,Cmd,有没有简单的方法可以通过PATH环境变量获取windows正在映射的exe的完整目录 比如: C:\>whereis myexe 看看这个答案。您可以将此处显示的脚本转换为批处理文件,该文件将按照您在问题中的建议工作: 此外,Windows 7中的Where commmand可执行以下操作: where myexe.exe 您可以创建此批处理文件并将exe文件作为参数 @setlocal @set P2=.;%PATH% @for %%e in (%PATHEXT%) do @for

有没有简单的方法可以通过PATH环境变量获取windows正在映射的exe的完整目录

比如:

C:\>whereis myexe

看看这个答案。您可以将此处显示的脚本转换为批处理文件,该文件将按照您在问题中的建议工作:

此外,Windows 7中的Where commmand可执行以下操作:

where myexe.exe

您可以创建此批处理文件并将exe文件作为参数

@setlocal
@set P2=.;%PATH%
@for %%e in (%PATHEXT%) do @for %%i in (%~n1%%e) do @if NOT "%%~$P2:i"=="" echo %%~$P2:i

您正在查找UNIX“which”命令。以下是windows版本:


您使用的是什么windows版本?