有没有简单的方法来获取windows通过PATH环境变量映射的exe的完整目录?
类似的东西:
C:\>whereis myexe
答案 0 :(得分:1)
看看这个答案。您可以将此处显示的脚本转换为批处理文件,该文件可以按照您在问题中的建议运行:
Find the path of notepad.exe and mspaint.exe
此外,Windows 7中的Where命令执行此操作:
where myexe.exe
答案 1 :(得分:0)
您可以创建此批处理文件并将exe文件作为参数
@setlocal
@set P2=.;%PATH%
@for %%e in (%PATHEXT%) do @for %%i in (%~n1%%e) do @if NOT "%%~$P2:i"=="" echo %%~$P2:i
答案 2 :(得分:0)
您正在寻找UNIX“which”命令。这是一个Windows版本:
http://pankaj-k.net/weblog/2004/11/equivalent_of_which_in_windows.html