PC Review


Reply
Thread Tools Rate Thread

command line VS cmd file

 
 
Jean Pierre Daviau
Guest
Posts: n/a
 
      20th Oct 2006
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


 
Reply With Quote
 
 
 
 
Matt Williamson
Guest
Posts: n/a
 
      20th Oct 2006
> 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)



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
billious
Guest
Posts: n/a
 
      20th Oct 2006

"Jean Pierre Daviau" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Alexander Suhovey
Guest
Posts: n/a
 
      20th Oct 2006
> -----Original Message-----
> From: billious [private.php?do=newpm&u=]
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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

--
Alexander Suhovey

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't create text file by command line command. Boki Digtal Microsoft C# .NET 1 23rd Jul 2007 07:26 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Windows XP General 5 4th Nov 2004 04:27 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Microsoft Windows 2000 5 4th Nov 2004 04:27 AM
Command line error D2016 : '/RTC1' and '/clr:initialappdomain' command-line options are incompatible Lars Grøtteland Microsoft Dot NET 1 15th Oct 2003 09:35 AM
pipe file input into command line command Roger Johnson Microsoft Windows 2000 CMD Promt 0 1st Aug 2003 11:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 PM.