I noticed that I have this file C:\Windows\System32\where.exe
installed, but changing PATH from System (or User ??) variable won't work. How to fix it in order to run it anywhere?
The "basic" (default) Path
(System
) variable under Windows 10 for Windows\System32
is %SystemRoot%\system32
. Adding this path to your Path
(System
) variables should enable where
from the command line, I believe.
Note that this doesn't include any other standard Path
(System
) variables, including:
%SystemRoot%
%SystemRoot%\System32\Wbem
%systemroot%\System32\WindowsPowerShell\v1.0\
and likely C:\Program Files (x86)\Windows Live\Shared
. This also doesn't include standard PATH
(User
) variables such as C:\Users\Your_User_Name\AppData\Local\Microsoft\WindowsApps
.
I don't want to look for each file individually through the explorer. Now I wanted to use "where" to gather paths quickly, but it turns out that it does not work because I've deleted its own path.
As already indicated in harrymc's answer, where
cannot do what you wish. It doesn't "discover" executable files or "remember" Path
\PATH
variables. If the relevant paths do not exist in your environment variables, where
cannot "find" those paths. You are going to have to go through Explorer\executables manually unless you use a system restore, as already detailed.
%pathext%
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
order and check if you have some other file namedwhere
with different .eXtension using:dir /b /a:a /s \where.exe
C:\Windows\System32\where.exe C:\Windows\SysWOW64\where.exe C:\Windows\WinSxS\amd64_microsoft-windows-where_31bf3856ad364e35_10.0.19041.1_none_13c446a37d881982\where.exe C:\Windows\WinSxS\wow64_microsoft-windows-where_31bf3856ad364e35_10.0.19041.1_none_1e18f0f5b1e8db7d\where.exe