Skip to main content

Posts

Showing posts with the label tips

Linux/Unix which command equivalent on Windows

"which" command on Linux can help locate executable files, somethings we need same function on windows. Here's how: if you're using Windows 7, there's a building command "where", so if you want to find where is "notepad.exe" for Microsoft Word, just fire up and command window and type: where notepad.exe you'll get something like: C:\>where.bat notepad.exe C:\WINDOWS\system32\notepad.exe C:\WINDOWS\notepad.exe on Windows XP, there's no build-in command, so create a batch file called where.bat with below content: @echo off for %%i in (%1) do if not ""=="%%~$PATH:i" echo %%~$PATH:i now, run where notepad.exe you'll get something like: C:\>where.bat notepad.exe C:\WINDOWS\system32\notepad.exe you can save the file in windows directory, so you can use it anywhere Attention: only executable list in environment variable PATH can be found just like the way Linux/Unix works.