Jump to content

FOR /F (Windows loop) How to make delims not single?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
xcislav

xcislav

    Newbie

  • Members
  • Pip
  • 3 posts
In loop FOR /F there is very good block separator delims= tokens=. But I'm frustrated that delims can hold only 1 symbol. But I want to extract from list only machines which run on 'Windows 2000' like:
FOR /F "delims='Windows 2000' tokens=2" %%i in (genlist.txt) do systeminfo /s %%i

File genlist.txt was produced by listing all the computers on network:
@echo off
FOR /F %%i in ('net view ^| find "\\"') do echo %%i

#2
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
I don't know about how to do that, but I did find some references:

Microsoft Corporation
for DOS command help
NT's FOR /F command: tokens and delims
For /f - Loop through text




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users