# How can I remove or deactivate the Windows system32/find.exe?

I am trying to make my Windows System as compatible with existing Makefiles as possible. One great step that is missing is replacing the windows "find" (which is the same as grep) with the GNU find (list of all files in directory and sub directories). Is this possible? (I already have msys find installed and ready to go. Just removing system32/find.exe would probably work, but unfortunately it is not possible that easily)

-
I rename my gnu utils find.exe to ufind.exe and use ufind –  user619818 Aug 10 '14 at 12:03
The problem with that is, that this solution would result in different Makefiles across building platforms (as long as I didn't wish to create a ufind link on my Linux machines) –  th3falc0n Aug 10 '14 at 12:06
Don’t do this. It will break stuff. Instead, use a GNU environment like Cygwin or MinGW. –  Daniel B Aug 10 '14 at 12:42
Well if I use the shell provided with msys in MinGW (which I am using) it is still dependent on Windows PATH variable which defines system32 and SysWOW64 as search paths and thus overrides the msys find. –  th3falc0n Aug 10 '14 at 12:47
If you use bash.exe or sh.exe then using find will invoke the GNU find instead of the Win32 find. sh.exe and bash.exe come with git or MinGW. –  Rapptz Aug 10 '14 at 17:18

Rather than removing Windows' find.exe, I strongly recommend putting GNU in your path before Windows\System32. For example, with Cygwin, you can use something like:

path c:\cygwin\bin;c:\windows\system32;c:\windows;c:\program files\foo;c:\program files\bar;c:\windows\system32\wbem

-
No need to do this manually, of course—it’s simply how this stuff works. From MSYS’ /etc/profile: export PATH=".:/usr/local/bin:/bin:/mingw/bin:\$PATH" –  Daniel B Aug 10 '14 at 13:19
If you go this route, it's better to limit the scope as much as possible. Don't change PATH for the entire system; change it only for the application you use (e.g. have a special batch file to launch a prompt with set PATH=\path\to\cygwin;%PATH%). This limits potential surprises later when you or someone else expects a Windows utility and instead gets a *nix one. –  Bob Aug 10 '14 at 14:56

You can gain access to all protected files by changing the ownership.

For Windows 7, on the file or folder that you want to edit: