List of files and subfolders in Windows sort order?

G

Guest

Hi, is there any way to get a list of all subfolders and files within those
subfolders in the same way in which they appear in Windows Explorer?
Ideally, I would like to be able to get this into a Word file. I have
searched online and have found some solutions that were close, but they don’t
give me exactly what I need in this particular situation. Part of the
problem is that I need this list to appear in the same order as it appears on
the screen in Explorer. I have tried the trick of going to the DOS prompt
and sending a list of files to a text file, but the order is different from
the order in which Windows displays the files. I then tried sorting the file
names in Word, but Word sorts differently than Windows when it comes to file
names with numbers in them.

It’s kind of a long story as to why I have to do this and have it in this
particular order, but the bottom line is that it’s something we need at work
and so far I haven’t been able to find a workaround except for screen
captures pasted into a Word document. Any help or advice would be greatly
appreciated. Thank you.
 
P

Pegasus \(MVP\)

FJ said:
Hi, is there any way to get a list of all subfolders and files within those
subfolders in the same way in which they appear in Windows Explorer?
Ideally, I would like to be able to get this into a Word file. I have
searched online and have found some solutions that were close, but they don't
give me exactly what I need in this particular situation. Part of the
problem is that I need this list to appear in the same order as it appears on
the screen in Explorer. I have tried the trick of going to the DOS prompt
and sending a list of files to a text file, but the order is different from
the order in which Windows displays the files. I then tried sorting the file
names in Word, but Word sorts differently than Windows when it comes to file
names with numbers in them.

It's kind of a long story as to why I have to do this and have it in this
particular order, but the bottom line is that it's something we need at work
and so far I haven't been able to find a workaround except for screen
captures pasted into a Word document. Any help or advice would be greatly
appreciated. Thank you.

When you are in a Command Prompt (which is often mistakenly
called "DOS Prompt"), type this command:

dir /?

You will then see that you can sort your directory listing in any
way you like, e.g.

dir /s /on
dir /s /oe
dir /s /od
dir /s /os

You may also want to add the /b switch.
 
G

Guest

Hi, Pegasus, thanks for your response. I'm sorry, I guess I should have
mentioned that I'm using Windows XP. The /on command gave me a list in name
order, but it's the sort order used by older versions of Windows and that is
still apparently used in Word and Excel 2003. Unfortunately, I need an list
in the same order as the files appear on the screen in Windows XP Explorer,
which is slightly different when there are numbers involved. I'm not sure if
this is possible. The company I work for does have third party software that
will print a list of files from Explorer, but it, too, uses the old Windows
sort order. Is there any workaround for this problem? Are there any macros
that would make Word sort the files in the same manner that Windows does so
that I could resort the file names once I got them into a Word document? Or
are there any macros that would pull the filenames into Word in the same
order that Explorer shows them? Or maybe any third party software that will
do this? Thanks in advance for any information.
 
P

Pegasus \(MVP\)

The sort order in Explorer is settable, same as the sort
order in a Command Prompt. Unless you post an
actual example, we don't know what you want and
why the /on switch for the "dir" command is not acceptable.
 
G

Guest

Hi, thanks for your response. Here is an example of the sort I want and the
sort that I am actually getting. I got these example from Microsoft's
knowledge base article 319827 about the difference in sorting order between
Windows XP and Windows 2000.

This is the sort order I want (this is the order in Windows XP Explorer):
Ie4_01
Ie4_128
Ie5
Ie6
Ie401sp2
Ie501sp2

And this is the sort order that Word 2003, Excel 2003, the command prompt
with /on, and everything else seems to give:
Ie4_01
Ie4_128
Ie401sp2
Ie5
Ie501sp2
Ie6

The reason I need the list in the same order as Windows Explorer is because
at work we often have huge print jobs that have to be split many different
ways. The powers that be want them tracked in a file that says who printed
what. When files contain only letters, we can use the third party software
to print a list of the documents in the same order as Explorer without any
problems, save it to Word, and keep track of things that way. When there are
files that contain numbers, as in the examples above, this presents a problem
because the order the third party software sorts in is different than the
sort order of Windows XP.

Thanks in advance for any advice or information.
 
A

Ayush

You can change the Explorer sorting order by using TweakUI | Explorer | "Use
Intuitive filename sorting"




Replied to [FJ]s message :
 
P

Pegasus \(MVP\)

I think you may have stumbled on a bug in Windows XP.
I am unable to see any reason why Ie6 should come before
Ie401sp2. This appears to be a problem in WinXP only -
in Win2000 the sort order in Explorer is as expected.

You may have to work around the problem by using file
names that do not contain number or by using file names
that have a uniform length.
 
G

Guest

Hi, thanks for your response. So, I guess there's no way to get other
applications to sort files like Windows XP does. It seems that the only way
to get a list of files to match what Explorer shows on the screen is to edit
the registry to make Windows match the sorting order of other applications,
not the other way around. I wonder why they decided to change the sort order
in Windows XP. I also wonder why they've never included a feature that
allows you to print lists of files from Windows. It would be very convenient
if they would do so.


Ayush" <"ayushmaan.j[aatt]gmail.com said:
You can change the Explorer sorting order by using TweakUI | Explorer | "Use
Intuitive filename sorting"




Replied to [FJ]s message :
This is the sort order I want (this is the order in Windows XP Explorer):
Ie4_01
Ie4_128
Ie5
Ie6
Ie401sp2
Ie501sp2

And this is the sort order that Word 2003, Excel 2003, the command prompt
with /on, and everything else seems to give:
Ie4_01
Ie4_128
Ie401sp2
Ie5
Ie501sp2
Ie6

The reason I need the list in the same order as Windows Explorer is because
at work we often have huge print jobs that have to be split many different
ways. The powers that be want them tracked in a file that says who printed
what. When files contain only letters, we can use the third party software
to print a list of the documents in the same order as Explorer without any
problems, save it to Word, and keep track of things that way. When there are
files that contain numbers, as in the examples above, this presents a problem
because the order the third party software sorts in is different than the
sort order of Windows XP.

Thanks in advance for any advice or information.
 
G

Guest

Hi, Pegasus, thanks for your response. I just kind of assumed that they
changed the sort order on purpose. According to the knowledge base article
that discusses the issue, Windows XP's sort order can be changed if you edit
the registry. I guess we could try to get permission to edit the registry on
the computers from which these files will be printed. BTW, here is a link to
the knowledge base article in case you're interested:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sort.mspx?mfr=true

Thanks for your help.
 
A

Ayush

Replied to [Pegasus (MVP)]s message :
I am unable to see any reason why Ie6 should come before
Ie401sp2. This appears to be a problem in WinXP only -
in Win2000 the sort order in Explorer is as expected.

This is intuitive file sorting - (The number 401 is bigger than 6.)

From TweakUI :
````````````````````````````````````````````````````
If you check the "Use intuitive filename sorting" box, Explorer
will sort files so that, for example, "File 5" comes before "File
10" because 5 comes before 10. If you uncheck this box,
then Explorer will use literal sorting, in which case "File 10" will
come before "File 5" because "1" comes before "5".
`````````````````````````````````````````````````````
 
P

Pegasus \(MVP\)

This is the first time I've heard of "intuitive file sorting" -
thanks for the pointer.


Ayush said:
Replied to [Pegasus (MVP)]s message :
I am unable to see any reason why Ie6 should come before
Ie401sp2. This appears to be a problem in WinXP only -
in Win2000 the sort order in Explorer is as expected.

This is intuitive file sorting - (The number 401 is bigger than 6.)

From TweakUI :
````````````````````````````````````````````````````
If you check the "Use intuitive filename sorting" box, Explorer
will sort files so that, for example, "File 5" comes before "File
10" because 5 comes before 10. If you uncheck this box,
then Explorer will use literal sorting, in which case "File 10" will
come before "File 5" because "1" comes before "5".
`````````````````````````````````````````````````````
 
D

Donald Lessau

FJ said:
Hi, is there any way to get a list of all subfolders and files within
those
subfolders in the same way in which they appear in Windows Explorer?

Replace "Windows Explorer" by "XYplorer" (shareware file manager) and the
answer is yes. XYplorer's "Report" functions do exactly what you want.

Don
 
G

Guest

Hi, Donald, thanks for your response. I went to XYplorer's website to check
it out and it seems to have some really cool features.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top