1
Vote

16 bit character and scripting trouble...

description

I've found your interesting tool, very cool!

I've to use it in some script, simple CMD one, and i've found that i was not able to do a simple 'find' or findstr';
 C:\Users\Administrator>\\file\wpkg\tools\NLMtool64.exe
 Windows NLM Tool version 0.1 (2015-10-11)
 For the documentation and new releases visit:
 https://windowsnlmtool.codeplex.com/

 Overall connectivity: IPV4_INTERNET IPV6_LOCALNETWORK
 ============ Now let's try to enumerate networks ============
                Index: 0
           Network id: {3178E6B0-90B8-46C4-B0F4-F967822745EC}
         Connectivity: IPV4_INTERNET IPV6_LOCALNETWORK
             Category: PRIVATE
          Domain type: NON_DOMAIN_NETWORK
                 Name: Rete
          Description: Rete
              Created: 2016-03-15 09:06:40
            Connected: 2016-05-23 11:32:33
 ================ No more (suitable) networks ================
     Listed networks: 1
      Total networks: 1

 C:\Users\Administrator>\\file\wpkg\tools\NLMtool64.exe | find "Listed networks: 1"

 C:\Users\Administrator>\\file\wpkg\tools\NLMtool64.exe | findstr /C:"Listed networks: 1"
After hitting my head on the wall, i think i've found the culprit:
 C:\Users\Administrator>\\file\wpkg\tools\NLMtool64.exe > %TEMP%\test.txt

 C:\Users\Administrator>type %TEMP%\test.txt
 Windows NLM Tool version 0.1 (2015-10-11)
 For the documentation and new releases visit:
 https://windowsnlmtool.codeplex.com/

 O v e r a l l   c o n n e c t i v i t y :   I P V 4 _ I N T E R N E T  I P V 6 _ L O C A L N E T W O R K
 = = = = = = = = = = = =   N o w   l e t ' s   t r y   t o   e n u m e r a t e  n e t w o r k s   = = = = = = = = = = = =
                               I n d e x :   0
                     N e t w o r k   i d :   { 3 1 7 8 E 6 B 0 - 9 0 B 8 - 4 6 C 4 - B 0 F 4 - F 9 6 7 8 2 2 7 4 5 E C }
                 C o n n e c t i v i t y :   I P V 4 _ I N T E R N E T I P V 6 _ L O C A L N E T W O R K
                         C a t e g o r y :   P R I V A T E
                   D o m a i n   t y p e :   N O N _ D O M A I N _ N E T W O R K
                                 N a m e :   R e t e
                   D e s c r i p t i o n :   R e t e
                           C r e a t e d :   2 0 1 6 - 0 3 - 1 5   0 9 : 0 6 : 4 0
                       C o n n e c t e d :   2 0 1 6 - 0 5 - 2 3   1 1 : 3 2 : 3 3
 = = = = = = = = = = = = = = = =   N o   m o r e   ( s u i t a b l e ) n e t w o r k s   = = = = = = = = = = = = = = = =
           L i s t e d   n e t w o r k s :   1
             T o t a l   n e t w o r k s :   1

 C:\Users\Administrator>
Seems to me that (apart the header) output is 'multibyte' (UCS16?), and
this confuse find.

Thanks.

comments

marcogaio wrote May 24, 2016 at 3:21 PM

A partial fix seems:
C:\Users\Administrator>\\file\wpkg\tools\NLMtool64.exe | findstr /r /c:"L.i.s.t.e.d. .n.e.t.w.o.r.k.s.:. .1."
           L i s t e d   n e t w o r k s :   1