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

How to modify this batch file, anyone know?

15 views
Skip to first unread message

Fairfax

unread,
Jun 2, 2010, 4:19:59 AM6/2/10
to
From this page here, there's a "print directory" batch file that one
puts in the SendTo folder that works quite well.

The batch file is this:
**********************************************
@echo Directory and sub-directory file listing dump by
RenegadeMinds.com.
@echo Visit http://Renegademinds.com for more Windows tips and
tricks
@echo and free software applications.
@echo
==================================================================
@echo
==================================================================
@echo Save this file as getDirList.bat in your SendTo directory.
@echo SendTo is under Documents and Settings in each user's
directory.
@echo Right-click on any directory in Windows Explorer and choose
@echo Send To - getDirList.bat
@echo
==================================================================
@echo
==================================================================
@echo Dumping directory listing to c:\dirListing.txt
@echo (This may take some time for large directory trees.)
@REM the /A switch lists all hidden and system files as well.
@REM the /S switch lists all subdirectories and their contents.
REM original line: @dir %1 /A /S > c:\dirListing.txt
@dir %1 /S > c:\dirListing.txt
@echo Opening c:\dirListing.txt in Notepad (Close notepad to
delete file)
@notepad c:\dirListing.txt
@echo Deleting c:\dirListing.txt
@del c:\dirListing.txt
@pause
**********************************************
(I removed the "/A", as can be seen above, so that I don't get the
hidden and system files listed.)


This gives this type of output:

Directory of C:\WINDOWS\pchealth\helpctr\System\images\16x16

2009.12.11 17:07 <DIR> .
2009.12.11 17:07 <DIR> ..
2009.12.11 17:07 2,358 arrow_blue_normal_shadow.bmp
2009.12.11 17:07 2,358 arrow_green_normal_shadow.bmp
2009.12.11 17:07 1,078 compat.bmp
2009.12.11 17:07 1,078 errmsg.bmp
2009.12.11 17:07 1,078 support.bmp
2009.12.11 17:07 1,078 tools.bmp
2009.12.11 17:07 1,078 update.bmp
2009.12.11 17:07 600 warning.gif
8 File(s) 10,706 bytes

As compared to the output that an app did:

C:\WINDOWS\pchealth\helpctr\System\images\16x16
==============================================
arrow_blue_normal_shadow.bmp
2 KB 2009.12.11 05:07:38 PM a
arrow_green_normal_shadow.bmp
2 KB 2009.12.11 05:07:38 PM a
compat.bmp
1 KB 2009.12.11 05:07:38 PM a
errmsg.bmp
1 KB 2009.12.11 05:07:38 PM a
support.bmp
1 KB 2009.12.11 05:07:38 PM a
tools.bmp
1 KB 2009.12.11 05:07:38 PM a
update.bmp
1 KB 2009.12.11 05:07:38 PM a
warning.gif
1 KB 2009.12.11 05:07:38 PM a

Total 8 file(s); Size: 10706 Byte(s)

They both lack. The one below looks awful due to word wrap on my
newsreader's interface but it is the better of the two since it
doesn't have all the extra, parent <DIR> references. Yet the second
doesn't have date or size or time of the files.

So I think I'll stick with the batch file, instead.

However, what I don't know how to do, or if it's even possible to do,
is to have the batch file leave out all these types of annoying
references:


2009.12.11 17:07 <DIR> .
2009.12.11 17:07 <DIR> ..


I'm getting a directory printing of a network files that turned out to
have thousands of entries. I could eliminate hundreds of lines if I
could keep all these <DIR> lines out of the final output.

Does anyone know how to modify the batch file above so that these
don't appear? thx

Fairfax

unread,
Jun 2, 2010, 4:22:24 AM6/2/10
to
(Re-sending since it turns out I don't have access to an old group,
alt.comp.editors.batch. It must be from a previous newsserver I had
at one point. Apologies. If anyone replies from that group, it looks
like I won't see it here. thx.)

Whiskers

unread,
Jun 2, 2010, 8:35:14 AM6/2/10
to
["alt.comp.editors.batch;," removed from Newsgroups header]

On 2010-06-02, Fairfax <Spa...@NoJunkMail.org> wrote:
> (Re-sending since it turns out I don't have access to an old group,
> alt.comp.editors.batch. It must be from a previous newsserver I had
> at one point. Apologies. If anyone replies from that group, it looks
> like I won't see it here. thx.)

[...]

Try to eliminate superfluous semi-colons from the Newsgroups header ;))

--
-- ^^^^^^^^^^
-- Whiskers
-- ~~~~~~~~~~

Ben Myers

unread,
Jun 2, 2010, 11:10:23 AM6/2/10
to
"Fairfax" <Spa...@NoJunkMail.org> wrote in message news:524c06lg8ud2eltqt...@4ax.com...

Try this:

@dir %1 /S /A-D-H-S > c:\dirListing.txt

Ben

thanatoid

unread,
Jun 2, 2010, 2:53:41 PM6/2/10
to
Fairfax <Spa...@NoJunkMail.org> wrote in
news:524c06lg8ud2eltqt...@4ax.com:

> From this page here, there's a "print directory" batch file
> that one puts in the SendTo folder that works quite well.
>
> The batch file is this:
> **********************************************
> @echo Directory and sub-directory file listing dump by
> RenegadeMinds.com.
> @echo Visit http://Renegademinds.com for more Windows
> tips and

<SNIP>

> Does anyone know how to modify the batch file above so that
> these don't appear? thx

As much fun as writing and testing batch files is, I prefer
this:
http://www.galcott.com/dp.htm

--
Of course, it is no easy matter to be polite; in so far, I mean,
as it requires us to show great respect for everybody, whereas
most people deserve none at all; and again in so far as it
demands that we should feign the most lively interest in people,
when we must be very glad that we have nothing to do with them.
- Arthur Schopenhauer

0 new messages