Quantcast
Viewing all articles
Browse latest Browse all 7

Answer by Manu for What is Windows' equivalent of the "which" command in Unix? Is there an equivalent PowerShell command?

If you want to make it short, create a one line which.cmd file with the content

echo %~$PATH:1

This will search the first parameter (%1) fed to the script and display the full path of found file.Good place to put this script in windows 10 is%LOCALAPPDATA%\Microsoft\WindowsApps\which.cmd

And you get your which command in path.

c:\>which cmd.exec:\>echo C:\Windows\System32\cmd.exeC:\Windows\System32\cmd.exe

Viewing all articles
Browse latest Browse all 7

Trending Articles