PC Review


Reply
Thread Tools Rate Thread

How do I list all files recursively,sorted,without PATH on command line ?

 
 
Claudia Miller
Guest
Posts: n/a
 
      31st Jul 2006
I want to list all files in a whole directory tree.
They should be sorted by their filenames EXCLUDING (!) the path.

If I type e.g.

dir /A /S /B

all files are listed but they are sorted including the prepended path part.

How can I omit/suppress the path and list only the files (and sort them) ?

I consider a DOS command (under Win2000/WinXP) or alternatively
an external utility is acceptable as well as long as it works at the command prompt.

Claudia

 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      31st Jul 2006

"Claudia Miller" <(E-Mail Removed)> wrote in message
news:44cdf9e4$0$24904$(E-Mail Removed)...
> I want to list all files in a whole directory tree.
> They should be sorted by their filenames EXCLUDING (!) the path.
>
> If I type e.g.
>
> dir /A /S /B
>
> all files are listed but they are sorted including the prepended path

part.
>
> How can I omit/suppress the path and list only the files (and sort them) ?
>
> I consider a DOS command (under Win2000/WinXP) or alternatively
> an external utility is acceptable as well as long as it works at the

command prompt.
>
> Claudia
>


This is a little difficult to achieve: DOS is an operating
system, same as Windows or Linux, and there is definitely
no DOS under Windows. There is also not a single
command in Windows that will do exactly what you want.
However, you could use this batch file:

@echo off
if exist "%temp%\dir.tmp" del "%temp%\dir.tmp"
for /r %%a in (.) do (
echo Processing %%a
dir "%%a" /a-d /b | find /i /v "file not found" >> "%temp%\dir.tmp"
)
type "%temp%\dir.tmp" | sort > "%temp%\dir.txt"
type "%temp%\dir.txt" | more


 
Reply With Quote
 
POP
Guest
Posts: n/a
 
      31st Jul 2006
DIR /s/o

Gives:
Directory of C:\CABS\Winxp\Dx9

05/21/2006 11:35 AM <DIR> .
05/21/2006 11:35 AM <DIR> ..
05/21/2006 11:35 AM 11,871,576 DX9NT.exe
05/21/2006 11:35 AM 450 INSTALLF.INI
05/21/2006 11:35 AM 450 INSTALLS.INI
05/21/2006 11:35 AM 450 INSTALLU.INI
05/21/2006 11:35 AM 553,984 PINSTALL.EXE
05/21/2006 11:35 AM 387 scriptit.scp
05/21/2006 11:35 AM 224 SRCD.es
05/21/2006 11:35 AM 224 SRCD.fr
05/21/2006 11:35 AM 236 SRCD.ini
9 File(s) 12,427,981 bytes

DIR /? for a list of all the tags.

HTH
Pop


In news:(E-Mail Removed),
Pegasus (MVP) <(E-Mail Removed)> typed:
> "Claudia Miller" <(E-Mail Removed)> wrote in message
> news:44cdf9e4$0$24904$(E-Mail Removed)...
> > I want to list all files in a whole directory tree.
> > They should be sorted by their filenames EXCLUDING (!) the
> > path.
> >
> > If I type e.g.
> >
> > dir /A /S /B
> >
> > all files are listed but they are sorted including the
> > prepended
> > path part.
> >
> > How can I omit/suppress the path and list only the files (and
> > sort
> > them) ?
> >
> > I consider a DOS command (under Win2000/WinXP) or
> > alternatively
> > an external utility is acceptable as well as long as it works
> > at
> > the command prompt.
> >
> > Claudia
> >

>



 
Reply With Quote
 
POP
Guest
Posts: n/a
 
      31st Jul 2006
You're an idiot for pretending not to know what the OP means.
Several DOS commands work in windows, plus a lot that MSDOS never
had. The names DOS vs Command Prompt are for people like you who
wish to creat confusion with newbies who don't know better. YOU
are the one who doesn't know any better though.

No discussion; it's a fact.


In news:(E-Mail Removed),
Pegasus (MVP) <(E-Mail Removed)> typed:
> "Claudia Miller" <(E-Mail Removed)> wrote in message
> news:44cdf9e4$0$24904$(E-Mail Removed)...
> > I want to list all files in a whole directory tree.
> > They should be sorted by their filenames EXCLUDING (!) the
> > path.
> >
> > If I type e.g.
> >
> > dir /A /S /B
> >
> > all files are listed but they are sorted including the
> > prepended
> > path part.
> >
> > How can I omit/suppress the path and list only the files (and
> > sort
> > them) ?
> >
> > I consider a DOS command (under Win2000/WinXP) or
> > alternatively
> > an external utility is acceptable as well as long as it works
> > at
> > the command prompt.
> >
> > Claudia
> >

>
> This is a little difficult to achieve: DOS is an operating
> system, same as Windows or Linux, and there is definitely
> no DOS under Windows. There is also not a single
> command in Windows that will do exactly what you want.
> However, you could use this batch file:
>
> @echo off
> if exist "%temp%\dir.tmp" del "%temp%\dir.tmp"
> for /r %%a in (.) do (
> echo Processing %%a
> dir "%%a" /a-d /b | find /i /v "file not found" >>
> "%temp%\dir.tmp"
> )
> type "%temp%\dir.tmp" | sort > "%temp%\dir.txt"
> type "%temp%\dir.txt" | more




 
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
Allen Browns List files recursively StuJol Microsoft Access 5 3rd Jun 2010 08:45 AM
Command Line Create list of Directories in sorted by Deepest directoryfirst EnterYourName Windows Vista File Management 0 13th Nov 2009 12:45 PM
List files recursively =?Utf-8?B?cmlja19pdA==?= Microsoft Access VBA Modules 2 13th Mar 2007 04:36 AM
How do I list all files recursively,sorted,without PATH on command line ? Claudia Miller Windows XP General 0 31st Jul 2006 01:39 PM
List Offline Files via Command Line nicough@hotmail.com Windows XP General 6 11th Nov 2005 11:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 AM.