Re: Batch file question
From: Angela (Angela_at_discussions.microsoft.com)
Date: 12/16/04
- Previous message: Steve Friedl [MVP/Security]: "Re: Batch file question"
- In reply to: Steve Friedl [MVP/Security]: "Re: Batch file question"
- Next in thread: Angela: "Re: Batch file question"
- Reply: Angela: "Re: Batch file question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 08:19:05 -0800
Steve,
I made both the same and tried it, "C:\>FOR /F "tokens=1" %%G IN
(C:\Textfile.txt) DO echo %%G
And received this:
%%G was unexpected at this time.
does that error shed any light?
"Steve Friedl [MVP/Security]" wrote:
> "Angela" <Angela@discussions.microsoft.com> wrote in message
> news:CACE84CD-789F-47A9-86BD-36185EAB82C0@microsoft.com...
> > 2) The command I'm trying to run is:
> > FOR /F "tokens=1" %G IN (C:\Textfile.txt) DO echo %g
>
> This is in a batch file, so you need to tell it that %G is a local
> placeholder and not "use the %G variable". Do this by doubling the %:
>
> FOR /F "tokens=1" %%G IN (c:\Textfile.txt) DO echo %%G
>
> Steve
>
> ---
> Steve Friedl -- Tustin, California USA -- www.unixwiz.net
> Unix Wizard -- Microsoft MVP/Security -- I speak for me only
>
>
>
- Previous message: Steve Friedl [MVP/Security]: "Re: Batch file question"
- In reply to: Steve Friedl [MVP/Security]: "Re: Batch file question"
- Next in thread: Angela: "Re: Batch file question"
- Reply: Angela: "Re: Batch file question"
- Messages sorted by: [ date ] [ thread ]