Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help with find command

3 views
Skip to first unread message

Walter

unread,
Oct 5, 2003, 12:59:33 PM10/5/03
to
how can I set a variable in a batch file to a field in the line returned
from a find command on windows 2000?

say a file has these lines and I want to search for 550 and if found, set
the variable to test.txt

also, in an unrelated question, is there a way to set the source property of
a file in dos? thanks


Connected to walter.
220 Microsoft FTP Service
User (walter:(none)): 331 Password required for walter.
230 User walter logged in.
ftp> 200 PORT command successful.
550 test.txt: The system cannot find the file specified.
ftp> 221


----== Posted via Usenet.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.Usenet.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Marty List

unread,
Oct 5, 2003, 1:19:04 PM10/5/03
to

<Walter> wrote in message news:3f804e6d$1...@news.Usenet.com...


Instead of using FIND, I would use the FOR command. Run "FOR /?" to view
the syntax.

@Echo Off
SetLocal
Set FILENAME=C:\Temp\Test.txt
For /F "tokens=1,2 delims=: " %%A In (%FILENAME%) Do (
If {%%A}=={550} Echo %%B
)


I don't know what you mean by "set the source property of a file". Also,
when you say "in dos" are you referring to the operating system MS-DOS, or
the command prompt under the Windows operating system?

Walter

unread,
Oct 5, 2003, 1:31:44 PM10/5/03
to
Thanks. By source I was referring to the properties available through
Explorer when you right click a file and select properties, then the summary
tab. And I was wondering if I could set these properties in a batch file.

"Marty List" <Bill....@sun.com> wrote in message
news:blpjq9$eqhvq$1...@ID-172409.news.uni-berlin.de...

Matthias Tacke

unread,
Oct 5, 2003, 2:03:12 PM10/5/03
to
<Walter> schrieb im Newsbeitrag news:3f805...@news.Usenet.com...

> Thanks. By source I was referring to the properties available through
> Explorer when you right click a file and select properties, then the
summary
> tab. And I was wondering if I could set these properties in a batch file.
>
You are wrong Walter in thinking this is a function of windows.
Test it with a plain textfile - no tab.

It depends on the fileformat, look for :
exe file format
coff file format
biff file format
etc.
YOu may start here
http://www.wotsit.org
http://www.wd-mag.com/link/subject153.htm?topic=links

hth
Matthias


Marty List

unread,
Oct 5, 2003, 3:06:09 PM10/5/03
to

"Matthias Tacke" <Matt...@Tacke.de> wrote in message
news:blpmcu$htg$07$1...@news.t-online.com...

To answer Walter's question, I don't know of a way to edit this info from
the command prompt.

To Matthias,

That's not exactly true. The "Summary" tab info comes from a stream or ADS
(alternate data stream). The ADS is a very hidden file in NTFS, attached to
the file's main data stream. Any file can have one or more ADS, including
plain text files. The ADS will be copied along with the file, unless you
copy it to a non-NTFS destination.

Google search:
http://groups.google.com/groups?q=NTFS+%22alternate+data+streams%22

Frank Heyne wrote a great tool for displaying streams:
http://www.heysoft.de/Frames/f_sw_la_en.htm

ADS FAQ:
http://www.heysoft.de/Frames/f_faq_ads_en.htm

C:\>Lads.exe C:\Temp

LADS - Freeware version 3.21
(C) Copyright 1998-2003 Frank Heyne Software (http://www.heysoft.de)
This program lists files with alternate data streams (ADS)
Use LADS on your own risk!

Scanning directory C:\Temp\

size ADS in file
---------- ---------------------------------
124 C:\Temp\ADSTest.txt:?DocumentSummaryInformation
224 C:\Temp\ADSTest.txt:?SummaryInformation
0 C:\Temp\ADSTest.txt:{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}

348 bytes in 3 ADS listed

Matthias Tacke

unread,
Oct 5, 2003, 5:59:00 PM10/5/03
to
"Marty List" <Bill....@sun.com> schrieb im Newsbeitrag
news:blpq32$en798$1...@ID-172409.news.uni-berlin.de...
nice program
<snip>

Hello Marty, thanks for the info,

I knew about ADS but didn't realize that they are really used by some
programs to store information (alternate/duplicate).

When i look at MS-Word .doc and MS-Excel *.xls then the summary-tab
(in german Dateiinfo) exists on fat and ntfs partions. So this can't
solely be stored in an ads.

The tabs are integrated functions from explorer to show additional
information. These can be extended via plugins. I have a nice one
for mp3-files. Since filetypes exist across partitiontypes this
information must then be copied/synchronized.

Since data is transfered between different media, ads is a nice
feature but you can't rely on. Even Ms doesn't support it with
all utilities. Btw. textual ads can be viewed without additional
progrmas. "more <filename.ext:adsname" does the trick without
cat from reskit. The information you add to the summarytab yourself
seems to be stored in unicode.

A scan of my ntfs showed only some .jpg and .gif with small ads.
I will have a look which program has appended them.

Matthias


Matthias Tacke

unread,
Oct 6, 2003, 9:34:10 AM10/6/03
to

<Walter> schrieb im Newsbeitrag news:3f805...@news.Usenet.com...
> Thanks. By source I was referring to the properties available through
> Explorer when you right click a file and select properties, then the
summary
> tab. And I was wondering if I could set these properties in a batch file.
>
I found a link which clarifies the topic with ADS (aka alternate data stream
not active directory) and summary tab on ntfs partitions/Ole-Documents.

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:
80/support/kb/articles/Q224/3/51.asp&NoWebContent=1

Without programming in VC / VB / maybe also vbscript there is no way of
reading changing the information from the command line.

Matthias


Mark V

unread,
Oct 6, 2003, 12:54:39 PM10/6/03
to
Matthias Tacke wrote in news:blrr0h$m21$03$1...@news.t-online.com:

>
> <Walter> schrieb im Newsbeitrag news:3f805...@news.Usenet.com...
>> Thanks. By source I was referring to the properties available
>> through Explorer when you right click a file and select
>> properties, then the
> summary
>> tab. And I was wondering if I could set these properties in a
>> batch file.
>>
> I found a link which clarifies the topic with ADS (aka alternate
> data stream not active directory) and summary tab on ntfs
> partitions/Ole-Documents.
>
> http://support.microsoft.com/default.aspx?scid=http://support.micro

> soft.com: 80/support/kb/articles/Q224/3/51.asp&NoWebContent=1


>
> Without programming in VC / VB / maybe also vbscript there is no
> way of reading changing the information from the command line.

Are you sure you are not mixing Document Properties (stored in the
document), but displayed in Explorer's file properties with actual
Alternate Data Stream content stored in the file system?


Matthias Tacke

unread,
Oct 6, 2003, 3:09:10 PM10/6/03
to
"Mark V" <notv...@invalid.nul> schrieb

> >>
> > I found a link which clarifies the topic with ADS (aka alternate
> > data stream not active directory) and summary tab on ntfs
> > partitions/Ole-Documents.
> >
> > http://support.microsoft.com/default.aspx?scid=http://support.micro
> > soft.com: 80/support/kb/articles/Q224/3/51.asp&NoWebContent=1
> >
> > Without programming in VC / VB / maybe also vbscript there is no
> > way of reading changing the information from the command line.
>
> Are you sure you are not mixing Document Properties (stored in the
> document), but displayed in Explorer's file properties with actual
> Alternate Data Stream content stored in the file system?
>
Not really Mark,
the question from walter :

>>>also, in an unrelated question, is there a way to set the
>>>source property of a file in dos? thanks

Is correctly answered with the above. The misleading point in all this
is, that microsoft has reused the "property set" structure from
their Office programs.
The link above, better formatted here,
http://support.microsoft.com/default.aspx?scid=kb;EN-US;224351
leads to a website where you can download a Visual
Basic example to read/change both types of this structure
- as part of an ole compound document and
- as an ad-stream on ntfs partitions.
So you can write an app with vb to do the desired.

The problem is that you can't write vb6 programs as console apps
with io redirection. You can manage to have a console window
which is created with launching the app, but that is a new
console window.

So to get the desired from a console you need a c-app. For
reading MS offers a sample here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;186898

I can't program in C, I will possibly do a gui vb app.

Matthias


Marty List

unread,
Oct 6, 2003, 4:26:46 PM10/6/03
to

"Matthias Tacke" <Matt...@Tacke.de> wrote in message
news:blsekp$96k$00$1...@news.t-online.com...

I'm thinking about tackling this in C++, but I haven't made up my mind yet.
I don't think I would ever use it, and I'm not sure how many others would.

Mark V

unread,
Oct 6, 2003, 6:15:19 PM10/6/03
to
Matthias Tacke wrote in news:blsekp$96k$00$1...@news.t-online.com:

> "Mark V" <notv...@invalid.nul> schrieb
>> >>
>> > I found a link which clarifies the topic with ADS (aka
>> > alternate data stream not active directory) and summary tab on
>> > ntfs partitions/Ole-Documents.
>> >
>> > http://support.microsoft.com/default.aspx?scid=http://support.mi

>> > cro soft.com:


>> > 80/support/kb/articles/Q224/3/51.asp&NoWebContent=1
>> >
>> > Without programming in VC / VB / maybe also vbscript there is
>> > no way of reading changing the information from the command
>> > line.
>>
>> Are you sure you are not mixing Document Properties (stored in
>> the document), but displayed in Explorer's file properties with
>> actual Alternate Data Stream content stored in the file system?
>>
> Not really Mark,
> the question from walter :
>>>>also, in an unrelated question, is there a way to set the
>>>>source property of a file in dos? thanks
>
> Is correctly answered with the above. The misleading point in all
> this is, that microsoft has reused the "property set" structure
> from their Office programs.

That's exactly where I got off track!

> The link above, better formatted here,
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;224351
> leads to a website where you can download a Visual
> Basic example to read/change both types of this structure
> - as part of an ole compound document and
> - as an ad-stream on ntfs partitions.
> So you can write an app with vb to do the desired.
>
> The problem is that you can't write vb6 programs as console apps
> with io redirection. You can manage to have a console window
> which is created with launching the app, but that is a new
> console window.
>
> So to get the desired from a console you need a c-app. For
> reading MS offers a sample here:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;186898
>
> I can't program in C, I will possibly do a gui vb app.
>
> Matthias

Thanks for the explanation.

Mark V

unread,
Oct 6, 2003, 6:16:25 PM10/6/03
to
Marty List wrote in
news:blsj67$f8o2v$1...@ID-172409.news.uni-berlin.de:

>
> "Matthias Tacke" <Matt...@Tacke.de> wrote in message
> news:blsekp$96k$00$1...@news.t-online.com...
>> "Mark V" <notv...@invalid.nul> schrieb
>> > >>
>> > > I found a link which clarifies the topic with ADS (aka
>> > > alternate data stream not active directory) and summary tab
>> > > on ntfs partitions/Ole-Documents.
>> > >
>> > > http://support.microsoft.com/default.aspx?scid=http://support.

>> > > micro soft.com:

> I'm thinking about tackling this in C++, but I haven't made up my
> mind yet. I don't think I would ever use it, and I'm not sure how
> many others would.

I doubt I'd use it much (if at all), but if I _needed_ it, it sure
would be nice to have. :-)

I guess it's up to you to decide if this project is
interesting/challenging enough to _you_. <G>.

0 new messages