'findstr' is not recognized as an internal or external command,

I got the following error while starting JBoss from a command line prompt today:

'findstr' is not recognized as an internal or external command

Please google it, you can find a lot of answers. But do as below to fix it. Add the following value to Right Click My Compuer -> Advanced -> Environment Variables -> System Variables -> Select Path variable -> append the below value.

C:\WINDOWS\system32

It should work with that change.

for me it works when I've coped findstr(from windows/system32) to wildfly/bin

Please go throught the simplest steps:-

  1. go to C:\Windows\system32\ and copy findstr.exe file.
  2. paste this file into the location C:\Program Files\Java\jdk1.6.0_24\bin
  3. Run your jboss again you will get out of this.....

Check to see if you %SystemRoot% is evaluating (type set path into a command prompt, you should not see %SystemRoot%, but instead that actual path). If your path variable's (user, or systems) first entry begins with an %(an environment variable) this can cause an issue.

To resolve this, simply swap this first entry with anything else in your path that does not lead with an environment variable.

You can also hard code the directory by replacing 'findstr' with 'C:\Windows\system32\findstr'. This is useful when using systems with restricted user permissions.

Comments
  • Pretty funny how you said "Please google it" because now this is the #1 result for "findstr is not recognized". :-P
  • Yes, but this is only a workaround. See my answer on how to fix the PATH variable.
  • After you add the PATH variable, you may be required to restart your application for the settings to take effect.
  • @StephenWylie Thank you :)
  • A neater way to specify the path is to use %systemroot%\system32
  • @AshuPhaugat just because it works doesn't mean it's the right way to do things. This is how we end up with bloated/broken software.
  • Which Windows version has by default case sensitive NTFS filesystem for system drive?