Batch file question

From: Angela (Angela_at_discussions.microsoft.com)
Date: 12/16/04


Date: Thu, 16 Dec 2004 05:17:11 -0800

1) I have a command I'm trying to run (test before putting it in a batch
file) which I basically want to run the same command but with different names
that are contained in a text file with single line entry's. The file I have
(Textfile.txt) contains:

computer1
computer2
computer3
computer4

2) The command I'm trying to run is:
FOR /F "tokens=1" %G IN (C:\Textfile.txt) DO echo %g

3) The output I'm getting is:

C:\>echo %g%g
C:\>echo %g%g
C:\>echo %g%g
C:\>echo %g%g

Eventually I'll be changing the echo command to something else, but what am
I doing wrong that the echo command is only putting out what I told it yet
it's cycling through the number of records in the file correctly?



Relevant Pages

  • Batch file question
    ... I have a command I'm trying to run (test before putting it in a batch ... Eventually I'll be changing the echo command to something else, ...
    (microsoft.public.win2000.general)
  • Re: Multi-zip files -- Windows server
    ... native DOS versions). ... TO BATCH OR NOT TO BATCH ... and using a batch file to try and solve the problem... ... The IBM PC operating system command line is a most ...
    (comp.sys.cbm)
  • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
    ... purely of statements processed completely by the native batch command ... > command processor, only because it comes free with the OS. ... Hey, guard, it is not PERFECT, OK? ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
    ... purely of statements processed completely by the native batch command ... > command processor, only because it comes free with the OS. ... Hey, guard, it is not PERFECT, OK? ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Batch file (CMD) output into HTA
    ... One could argue that "real dos" and the NT command prompt have ... be a group for console operations, ... crosspost to batch, vbscript, wsh, powershell, and possibly other groups. ... are also using VBS and just don't know where else ...
    (microsoft.public.scripting.vbscript)

Loading