batch find command not working
Asked Answered
T

1

7

does anyone know why this would not work (Windows 7, batch script)?

C:\testing>FINDSTR /R /N "^.*$" test.txt | FIND /C ":"

FIND: `/C': No such file or directory
FIND: `:': No such file or directory
Tomfool answered 28/10, 2013 at 18:38 Comment(7)
Works for me too. Do you have find overridden somehow with another find in your path? Do you have a DOSKEY macro overriding find? What do you get when you run where find.exe?Covet
@CookieButter - yes.Looks like an error produced by the unix find. @Tomfool - what is the output of find -h ?Jordan
find-h : 'find-h' is not recognized as an internal or external command, operable program or batch file.Tomfool
sorry, missed the spaceTomfool
find -h: find: unknown predicate `-h'Tomfool
definitely not the windows command .Try with FINDSTR /R /N "^.*$" test.txt | %windir\system32\%FIND /C ":"Jordan
the out put of windows find -h is FIND: Parameter format not correct . May be you are using unix port that requires -H (upper case) to show it's help or --help or -helpJordan
J
11

try with :

FINDSTR /R /N "^.*$" test.txt | %windir%\system32\FIND.exe /C ":"

Meanwhile with:

for %f in (find.exe) do @echo %~dpfnx$PATH:f

(double % for batch file) you can see which FIND.EXE will be executed.

Jordan answered 28/10, 2013 at 20:2 Comment(2)
okay ... I have cygwin installed so the unix find command must be interfering with the batch command like npocmaka and cookie stated. Thanks so much for the help.Tomfool
I had the exact same problem. C:\Program Files (x86)\Git\bin\find.exe was executed! Thanks.Premer

© 2022 - 2024 — McMap. All rights reserved.