43

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

'findstr' is not recognized as an internal or external command
Nayuki
  • 17,911
  • 6
  • 53
  • 80
user1314506
  • 641
  • 2
  • 9
  • 14

10 Answers10

88

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.

Phani
  • 5,319
  • 6
  • 35
  • 43
4

As others pointed, issue is in wrong settings of PATH variable in Windows. According to article this is most probably because some stupid installer wrongly modified PATH variable in Windows registry. Registry has 2 different string value types - REG_SZ and REG_EXPAND_SZ. Only the second one allows for expansion of %SystemRoot%.

So check your path by typing set path in command prompt. If you see unexpanded %SystemRoot% and other variables in Path, you are affected (PATH should show only plain directory names, not variables).

You need to edit Path variable in registry: HKEY_CURRENT_USER\Environment and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. As it is not possible to change the type of key, save the path value somewhere, delete the key and re-create it with type REG_EXPAND_SZ. You need to logout for changes to take effect.

Marki555
  • 6,434
  • 3
  • 37
  • 59
3

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

Ssss
  • 39
  • 1
2

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.....
andrewsi
  • 10,807
  • 132
  • 35
  • 51
Suryaprakash
  • 101
  • 1
  • 1
  • 8
    @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. – autonomy Dec 28 '17 at 18:13
1

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.

Mike Casa
  • 451
  • 7
  • 14
1

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.

0

I have try to work with play framework but stuck with to run activator.bat file but solution is the same just copy file from windows/system32/findsr and past it to under stuck folder then run the respective file again. thanks to andrewsiand Suryaprakash

I.Sharma
  • 21
  • 5
0

Please beware that current Windows systems use a Capital "S" for the System directory, so: C:\WINDOWS\System32 %SystemRoot%\System32

Omitting the capital S will result in a neglect of the line in the %PATH%

0

In my case (not JBoss related) the following helped to fixed this error.

Instead of:

SET path="%path%;C:\some\additional\path"

I used:

SET "path=%path%;C:\some\additional\path"
Denxorz
  • 316
  • 1
  • 4
  • 15
0

For IBM ACE solution for

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

  1. Go to the path C:\Windows\System32

  2. Find the findstr.exe, copy it and then find the path where you bin file of your application is found. eg C:\Program Files\IBM\ACE\11.0.0.12\server\bin then past it inside the bin file

  3. cancel the console of ace and re-open it.

  4. Then run ACE toolkit command on ace console.

  5. Then press enter, now it can open.

Motuma
  • 11
  • 1