PC Review


Reply
Thread Tools Rate Thread

Can anybody tell me what this DOS code does?

 
 
Academia
Guest
Posts: n/a
 
      19th Jan 2008
Can anybody tell me what this code does?

The find should be after the | not on a separate line.

Should there be a space between the | and find ?

I think I understand the xcopy except for the c:\
Is the c:\ just a filler that is required but not used because of the /L

But what does ^| do?

I think the pipe sends the xcopy output to the find but what does the ^ do?



Thanks


for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
find ":"') do (
echo Decompressing "%%a"
)


 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      19th Jan 2008

"Academia" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can anybody tell me what this code does?
>
> The find should be after the | not on a separate line.
>
> Should there be a space between the | and find ?
>
> I think I understand the xcopy except for the c:\
> Is the c:\ just a filler that is required but not used because of the /L
>
> But what does ^| do?
>
> I think the pipe sends the xcopy output to the find but what does the ^
> do?
>
>
>
> Thanks
>
>
> for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
> find ":"') do (
> echo Decompressing "%%a"
> )
>


This code comes out of my own kitchen, so here is a brief explanation.

For starts, it is not DOS code. DOS is an operating system sold by
Microsoft in about 1979. It could not possibly understand this stuff.
It is batch code running under WinXP or Win2000.

You can have a space after the | but you don't need one.

The "C:\" part is the destination for the "xcopy" command.
However, since I have used the /L switch, no copy action
will take place, so its actual value is of academic interest.

As you say, the | bar sends the output from the xcopy command
to the "find" command. Since the xcopy command is invoked
inside a "for" loop, the bar must be escaped with a carot
symbol, i.e. like so: ^|. This is advanced batch file stuff.

I now realise that I forgot to flag your original post for further
attention. If you still have problems with my batch file, please
return to the original thread.


 
Reply With Quote
 
Don Wiss
Guest
Posts: n/a
 
      19th Jan 2008
On Sat, 19 Jan 2008, "Pegasus \(MVP\)" <(E-Mail Removed)> wrote:

>For starts, it is not DOS code. DOS is an operating system sold by
>Microsoft in about 1979. It could not possibly understand this stuff.
>It is batch code running under WinXP or Win2000.


I knew you were going to post this. *Every* time someone posts a question
about DOS you have to jump in and correct them that there is no DOS.
*Every* time without fail.

Don <www.donwiss.com> (e-mail link at home page bottom).
 
Reply With Quote
 
Zilbandy
Guest
Posts: n/a
 
      19th Jan 2008
On Sat, 19 Jan 2008 16:13:46 -0500, Don Wiss <donwiss@no_spam.com>
wrote:

>>For starts, it is not DOS code. DOS is an operating system sold by
>>Microsoft in about 1979. It could not possibly understand this stuff.
>>It is batch code running under WinXP or Win2000.

>
>I knew you were going to post this. *Every* time someone posts a question
>about DOS you have to jump in and correct them that there is no DOS.
>*Every* time without fail.


And, as a result, there is one more informed person out there now. I
don't see the problem. I was misinformed one time myself.

--
Zilbandy
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      19th Jan 2008

"Don Wiss" <donwiss@no_spam.com> wrote in message
news:(E-Mail Removed)...
> On Sat, 19 Jan 2008, "Pegasus \(MVP\)" <(E-Mail Removed)> wrote:
>
>>For starts, it is not DOS code. DOS is an operating system sold by
>>Microsoft in about 1979. It could not possibly understand this stuff.
>>It is batch code running under WinXP or Win2000.

>
> I knew you were going to post this. *Every* time someone posts a question
> about DOS you have to jump in and correct them that there is no DOS.
> *Every* time without fail.
>
> Don <www.donwiss.com> (e-mail link at home page bottom).


Feel free to call it DOS. Call it Linux if you like, CP/M if you prefer.
Unfortunately the code posted by the OP won't run on DOS, Linux
or CP/M.


 
Reply With Quote
 
Academia
Guest
Posts: n/a
 
      20th Jan 2008

"Pegasus (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Academia" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Can anybody tell me what this code does?
>>
>> The find should be after the | not on a separate line.
>>
>> Should there be a space between the | and find ?
>>
>> I think I understand the xcopy except for the c:\
>> Is the c:\ just a filler that is required but not used because of the /L
>>
>> But what does ^| do?
>>
>> I think the pipe sends the xcopy output to the find but what does the ^
>> do?
>>
>>
>>
>> Thanks
>>
>>
>> for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
>> find ":"') do (
>> echo Decompressing "%%a"
>> )
>>

>
> This code comes out of my own kitchen, so here is a brief explanation.
>
> For starts, it is not DOS code. DOS is an operating system sold by
> Microsoft in about 1979. It could not possibly understand this stuff.
> It is batch code running under WinXP or Win2000.


To me "batch" means the app is run and all the output becomes available upon
completion. In contrast to interactive. With this definition all batch runs
need not be in the same language. For example if I wrote a vbs program to
delete a bunch if files then terninate; I'd call that a vbs batch program.
But a similer program that asks about each file, I'd call interactive.
Probably that has changed in the last 20 years or so, or maybe the
definition always varied with the platforms.

Is that how this is always refered to on the pc (Batch code) ? Makes sense
if it is more than a coincident that "batch" starts with "bat" and the file
extension is .bat.

Thanks for taking the time to point that out and for the info below.

I am having a problem but will decribe it in the other thread.

thanks again



>
> You can have a space after the | but you don't need one.
>
> The "C:\" part is the destination for the "xcopy" command.
> However, since I have used the /L switch, no copy action
> will take place, so its actual value is of academic interest.
>
> As you say, the | bar sends the output from the xcopy command
> to the "find" command. Since the xcopy command is invoked
> inside a "for" loop, the bar must be escaped with a carot
> symbol, i.e. like so: ^|. This is advanced batch file stuff.
>
> I now realise that I forgot to flag your original post for further
> attention. If you still have problems with my batch file, please
> return to the original thread.
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      20th Jan 2008

"Academia" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "Academia" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Can anybody tell me what this code does?
>>>
>>> The find should be after the | not on a separate line.
>>>
>>> Should there be a space between the | and find ?
>>>
>>> I think I understand the xcopy except for the c:\
>>> Is the c:\ just a filler that is required but not used because of the /L
>>>
>>> But what does ^| do?
>>>
>>> I think the pipe sends the xcopy output to the find but what does the ^
>>> do?
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>> for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
>>> find ":"') do (
>>> echo Decompressing "%%a"
>>> )
>>>

>>
>> This code comes out of my own kitchen, so here is a brief explanation.
>>
>> For starts, it is not DOS code. DOS is an operating system sold by
>> Microsoft in about 1979. It could not possibly understand this stuff.
>> It is batch code running under WinXP or Win2000.

>
> To me "batch" means the app is run and all the output becomes available
> upon completion. In contrast to interactive. With this definition all
> batch runs need not be in the same language. For example if I wrote a vbs
> program to delete a bunch if files then terninate; I'd call that a vbs
> batch program. But a similer program that asks about each file, I'd call
> interactive. Probably that has changed in the last 20 years or so, or
> maybe the definition always varied with the platforms.
>
> Is that how this is always refered to on the pc (Batch code) ? Makes
> sense if it is more than a coincident that "batch" starts with "bat" and
> the file extension is .bat.
>
> Thanks for taking the time to point that out and for the info below.
>
> I am having a problem but will decribe it in the other thread.
>
> thanks again
>
>
>
>>
>> You can have a space after the | but you don't need one.
>>
>> The "C:\" part is the destination for the "xcopy" command.
>> However, since I have used the /L switch, no copy action
>> will take place, so its actual value is of academic interest.
>>
>> As you say, the | bar sends the output from the xcopy command
>> to the "find" command. Since the xcopy command is invoked
>> inside a "for" loop, the bar must be escaped with a carot
>> symbol, i.e. like so: ^|. This is advanced batch file stuff.
>>
>> I now realise that I forgot to flag your original post for further
>> attention. If you still have problems with my batch file, please
>> return to the original thread.
>>

>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      20th Jan 2008

"Academia" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "Academia" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Can anybody tell me what this code does?
>>>
>>> The find should be after the | not on a separate line.
>>>
>>> Should there be a space between the | and find ?
>>>
>>> I think I understand the xcopy except for the c:\
>>> Is the c:\ just a filler that is required but not used because of the /L
>>>
>>> But what does ^| do?
>>>
>>> I think the pipe sends the xcopy output to the find but what does the ^
>>> do?
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>> for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
>>> find ":"') do (
>>> echo Decompressing "%%a"
>>> )
>>>

>>
>> This code comes out of my own kitchen, so here is a brief explanation.
>>
>> For starts, it is not DOS code. DOS is an operating system sold by
>> Microsoft in about 1979. It could not possibly understand this stuff.
>> It is batch code running under WinXP or Win2000.

>
> To me "batch" means the app is run and all the output becomes available
> upon completion. In contrast to interactive. With this definition all
> batch runs need not be in the same language. For example if I wrote a vbs
> program to delete a bunch if files then terninate; I'd call that a vbs
> batch program. But a similer program that asks about each file, I'd call
> interactive. Probably that has changed in the last 20 years or so, or
> maybe the definition always varied with the platforms.
>
> Is that how this is always refered to on the pc (Batch code) ? Makes
> sense if it is more than a coincident that "batch" starts with "bat" and
> the file extension is .bat.
>
> Thanks for taking the time to point that out and for the info below.
>
> I am having a problem but will decribe it in the other thread.
>
> thanks again
>


From the linguistic point of view you're right: A batch process will
deal with a whole lot of items in one fell sweep, without further
interaction.

In the world of Windows things are a little different. I can think of
at least three different environments:
- A batch file: A collection of console commands such as copy,
delete, cd that execute in a non-GUI environment and that may
or may not ask the user for further input. Input to a batch file
is via the console, output is to the console. A batch file may
invoke a GUI application. Batch files have a .bat or a .cmd
extension.
- A VB Script file. A collection of VB commands that are
interpreted by cscript.exe or wscript.exe. Some VB Script
code executes in a console environment, some in a GUI
environment. Input can come via the console or via a dialog
box - same for output. VB Script files have an extension
of .vbs.
- A GUI. Such applications, e.g. MS Word, do not normally
interact at a console level, only with a graphical user interface.
Most GUIs are invoked with a .exe file.

In other words - batch files and VB Script files can and often
do ask the user for further input.


 
Reply With Quote
 
Telstar
Guest
Posts: n/a
 
      20th Jan 2008
After all of this punctilious stupidity...no one answered the question!


 
Reply With Quote
 
Academia
Guest
Posts: n/a
 
      20th Jan 2008
Thanks

"Pegasus (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Academia" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>
>> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>
>>> "Academia" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Can anybody tell me what this code does?
>>>>
>>>> The find should be after the | not on a separate line.
>>>>
>>>> Should there be a space between the | and find ?
>>>>
>>>> I think I understand the xcopy except for the c:\
>>>> Is the c:\ just a filler that is required but not used because of the
>>>> /L
>>>>
>>>> But what does ^| do?
>>>>
>>>> I think the pipe sends the xcopy output to the find but what does the ^
>>>> do?
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>> for /F "delims=" %%a in ('xcopy /s /L /d:%MyDate% "%Source%\*.*" c:\ ^|
>>>> find ":"') do (
>>>> echo Decompressing "%%a"
>>>> )
>>>>
>>>
>>> This code comes out of my own kitchen, so here is a brief explanation.
>>>
>>> For starts, it is not DOS code. DOS is an operating system sold by
>>> Microsoft in about 1979. It could not possibly understand this stuff.
>>> It is batch code running under WinXP or Win2000.

>>
>> To me "batch" means the app is run and all the output becomes available
>> upon completion. In contrast to interactive. With this definition all
>> batch runs need not be in the same language. For example if I wrote a vbs
>> program to delete a bunch if files then terninate; I'd call that a vbs
>> batch program. But a similer program that asks about each file, I'd call
>> interactive. Probably that has changed in the last 20 years or so, or
>> maybe the definition always varied with the platforms.
>>
>> Is that how this is always refered to on the pc (Batch code) ? Makes
>> sense if it is more than a coincident that "batch" starts with "bat" and
>> the file extension is .bat.
>>
>> Thanks for taking the time to point that out and for the info below.
>>
>> I am having a problem but will decribe it in the other thread.
>>
>> thanks again
>>

>
> From the linguistic point of view you're right: A batch process will
> deal with a whole lot of items in one fell sweep, without further
> interaction.
>
> In the world of Windows things are a little different. I can think of
> at least three different environments:
> - A batch file: A collection of console commands such as copy,
> delete, cd that execute in a non-GUI environment and that may
> or may not ask the user for further input. Input to a batch file
> is via the console, output is to the console. A batch file may
> invoke a GUI application. Batch files have a .bat or a .cmd
> extension.
> - A VB Script file. A collection of VB commands that are
> interpreted by cscript.exe or wscript.exe. Some VB Script
> code executes in a console environment, some in a GUI
> environment. Input can come via the console or via a dialog
> box - same for output. VB Script files have an extension
> of .vbs.
> - A GUI. Such applications, e.g. MS Word, do not normally
> interact at a console level, only with a graphical user interface.
> Most GUIs are invoked with a .exe file.
>
> In other words - batch files and VB Script files can and often
> do ask the user for further input.
>



 
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
Linq to XML--Are there code examples that make Linq as easy as SQL? Or how can I convert ths simple pseudo code into real code? Reece Microsoft C# .NET 4 10th Dec 2008 03:13 AM
ATI Radeon Drivers - Code 43, Code 37 & Code 10 =?Utf-8?B?SmFrZQ==?= Windows Vista Hardware 14 29th Aug 2006 05:50 AM
ATI Display Drivers - Code 43, Code 37, Code 10 Jake Windows Vista Hardware 2 8th Jul 2006 04:00 PM
what is the difference between code inside a <script> tag and code in the code-behind file? keithb Microsoft ASP .NET 1 29th Mar 2006 02:00 AM
[New] Zipoid - ZIP Code, City Name and Area Code Lookup - Zip Code to Zip Code Distance Calculation Mel Freeware 0 22nd Jul 2005 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 PM.