Abhineet
Abhineet

Reputation: 6637

What is wrong in the below findstr example

The following FINDSTR example gives me error.

"%JAVA%" -version 2>&1 | findstr /I hotspot > nul

Error: 'findstr' is not recognized as an internal or external command, operable program or batch file.

Why?

Upvotes: 2

Views: 1325

Answers (3)

Abhijit Kalta
Abhijit Kalta

Reputation: 79

Right Click On My Computer - Advanced - Environment Variables - System Variables - Select Path variable - append the below

C:\WINDOWS\system32

Upvotes: 0

paxdiablo
paxdiablo

Reputation: 882626

Okay, you need to make sure that findstr.exe actually exists (in c:\windows\system32 by default).

If not (unlikely), that's your problem.

If it does exist, make sure that the directory it exists in is in your path. Executing path from a command window will show this.

Try to execute:

echo hello | findstr /I hello

and see what happens. If that works and the Java one doesn't, it's possible that Java itself may be modifying the path in a way that makes findstr disappear.

Upvotes: 4

jpmuc
jpmuc

Reputation: 1154

i think you mean "find". Try,

find /?

Upvotes: 0

Related Questions