[wpkg-users] find/findstr and multibyte...

Marco Gaiarin gaio at sv.lnf.it
Wed May 25 10:03:33 CEST 2016


Mandi! Dave Evans
  In chel di` si favelave...

> but the whole code can be simplified like this:

Ok, thanks. I've not minded about variables...

> note that findstr (like find) returns a non-zero error code if the
> string is NOT found, so your check should come out TRUE if the
> string is found

Yes, exactly what i need.


> as to the question you posed why is it different if you use %comspec% /c?
> have you tried doing
> %COMSPEC% /c "%WPKGROOT%\tools\NLMTool%arch%.exe" > file1.txt
> "%WPKGROOT%\tools\NLMTool%arch%.exe" > file2.txt
> then open the two files with a text editor (or a hex editor) and see
> if there are any differences.

No, they are the same.


I've also tried to run the command by hand, for user SYSTEM, and seems
to work:

 C:\Windows\Temp>set WPKGROOT=\\file\wpkg
 C:\Windows\Temp>%COMSPEC% /c "%WPKGROOT%\tools\NLMTool64.exe" | findstr /r /c:"C.a.t.e.g.o.r.y.:. .P.R.I.V.A.T.E."
                         C a t e g o r y :   P R I V A T E
 C:\Windows\Temp>echo %ERRORLEVEL%
 0
 C:\Windows\Temp>

Boh...

-- 
dott. Marco Gaiarin				        GNUPG Key ID: 240A3D66
  Associazione ``La Nostra Famiglia''          http://www.lanostrafamiglia.it/
  Polo FVG   -   Via della Bontà, 7 - 33078   -   San Vito al Tagliamento (PN)
  marco.gaiarin(at)lanostrafamiglia.it   t +39-0434-842711   f +39-0434-842797

		Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA!
    http://www.lanostrafamiglia.it/25/index.php/component/k2/item/123
	(cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)


More information about the wpkg-users mailing list