command line VS cmd file

  • Thread starter Thread starter Jean Pierre Daviau
  • Start date Start date
J

Jean Pierre Daviau

Hi again,

This works on the command line

for /r %I in (*jeanpierredaviau*.txt) do (type "%I" >> _trash.txt)

but not in a batch file?

--
Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
Server version: Apache/2.0.55
Server built: Oct 9 2005 19:16:56
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp
http://www.jeanpierredaviau.com
 
This works on the command line
for /r %I in (*jeanpierredaviau*.txt) do (type "%I" >> _trash.txt)

but not in a batch file?


You need to double your %'s a batch file.

for /r %%I in (*jeanpierredaviau*.txt) do (type "%%I" >> _trash.txt)
 
Jean Pierre Daviau said:
Hi again,

This works on the command line

for /r %I in (*jeanpierredaviau*.txt) do (type "%I" >> _trash.txt)

but not in a batch file?

--
Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
Server version: Apache/2.0.55
Server built: Oct 9 2005 19:16:56
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp
http://www.jeanpierredaviau.com

works fine for me - if you double the "%" signs - even if the directorynames
contain spaces and other non-alphamerics.

for /r %%I in (*jeanpierredaviau*.txt) do (type "%%I" >> _trash.txt)

? You'd find a lot of relevant information in alt.msdos.batch.nt
 
-----Original Message-----
From: billious [mailto:[email protected]]
Posted At: Friday, October 20, 2006 8:12 PM
Posted To: microsoft.public.win2000.cmdprompt.admin
Conversation: command line VS cmd file
Subject: Re: command line VS cmd file


Jean Pierre Daviau said:
Hi again,

This works on the command line

for /r %I in (*jeanpierredaviau*.txt) do (type "%I" >> _trash.txt)

but not in a batch file?

--
Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8 with Apache1.3.24
Server version: Apache/2.0.55
Server built: Oct 9 2005 19:16:56
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp
http://www.jeanpierredaviau.com

works fine for me - if you double the "%" signs - even if the
directorynames
contain spaces and other non-alphamerics.

for /r %%I in (*jeanpierredaviau*.txt) do (type "%%I" >> _trash.txt)

? You'd find a lot of relevant information in alt.msdos.batch.nt


It's also explained in FOR /?:

C:\>for /? | find "%%"
To use the FOR command in a batch program, specify %%variable instead
 
Back
Top