command line VS cmd file

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
 
M

Matt Williamson

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)
 
B

billious

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
 
A

Alexander Suhovey

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

for /d %I in ("%USERPROFILE%\Cookie\*jeanpierredaviau*.txt") do @echo %I 1
pushd 4
FC 3
special characters 18
cmd and win98 1
zeroing a registery key programmatically 3
mailto 23
setting screen in ansi on the fly 1

Top