DOS FIND Query

Soldato
Joined
23 Nov 2004
Posts
3,794
Hi,

I'm struggeling to get find to work in one of my scripts.

I have error checking and i want different outcomes if it doesn't find "HP LaserJet 4 Plus Driver" to if it does.

If i search for "12233rfHP LaserJet 4 Plus Driver" it still finds the string, even with the /I flag not set. (I have another script calling the below script which outputs to Results.txt)

Is there another way of doing this? (See script below).

Code:
Echo Searching for HP LaserJet 4 Plus Driver String...
find "HP LaserJet 4 Plus" Results.txt
	if not %errorlevel% == 0 goto FAIL
	echo %1 SUCCESS! HP LaserJet 4 Plus Driver is being used! >>Success.txt
	goto FINISH
:FAIL
	Echo %1 Is Not Using the HP LaserJet 4 Plus Driver" >>Failures.txt
:FINISH
exit
 
bitslice said:
I think you made a typo...

remove the quote after (Driver")
seems to work now

:)

------------------------
Echo Searching for HP LaserJet 4 Plus Driver String...
find "HP LaserJet 4 Plus" Results.txt
if not %errorlevel% == 0 goto FAIL
echo %1 SUCCESS! HP LaserJet 4 Plus Driver is being used! >> Success.txt
goto FINISH

:FAIL
Echo %1 Is Not Using the HP LaserJet 4 Plus Driver >> Failures.txt

:FINISH
exit

---------------------

Ah yea i did spot that, earlier, and changed that but it still finds the key.

It just found "123ewdfHP LaserJet 4 Plus"

Any other ideas?
 
Back
Top Bottom