Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


E-66

Possible to reorganize (not sort) a DOS directory alphabetically?

Recommended Posts

[i wasn't sure which forum to post this in so I put it here for now]

When viewing the contents of a directory/folder, I read that DOS (or a DOS box in Windows) displays files in the sequence that their entries occur in the directory table. I guess that means by the order they were created? So if you do a "dir" command, the files will most likely appear in a completely random order alphabetically. You can overcome this by using "dir /o" to view them alphabetically. You can also drag all the files to a new folder and they'll appear alphabetically using just the standard "dir" command.

What I'd like to know is if there's a command to "reinitialize" a DOS folder (and subfolders) so that the files will appear in alphabetical order by default, using just "dir". Thanks.

Edited by dencorso
[Solved] added to title.

Share this post


Link to post
Share on other sites

Thanks jaclaz, but that doesn't really help. It's my fault, I wasn't clear enough in my first post.

Seeing things alphabetically when using the "dir" command is fine, but the reason I asked if there's a command to "reinitialize" a folder in DOS (or maybe I meant reinitialize the DOS Directory Table?) is because I want to know if there's a way to have the files processed alphabetically when the directory is being accessed.

I'm using a program that goes through a directory tree of .wav files from my CD rips and then writes output text files with info about the files. Those text files don't always have the files (songs) listed in the correct alphabetical/numerical order. I can get around the problem in 2 different ways, but both are pains in the a**.

1. I can edit an 'incorrect' text file and cut & paste things into the correct order.

2. If a text file shows songs in the wrong order I can go to the source folder, drag & drop all the .wav files into a new folder, then drag & drop them back and run that directory through the program again. (I did try creating an identical empty folder tree and then copying all the .wav into it with xxcopy but that didn't fix the output text files; I had to physically drag & drop the files out of the source folder and then back into it in order to 'reset' how DOS saw and processed the folder)

I really don't want to consider either of these options since I'm talking about hundreds of folders, and thousands of files. Any ideas?

Share this post


Link to post
Share on other sites

Way back when, there was DS.EXE (Directory Sort, part of Norton Utilities for DOS, hence not free), that did exactly what you want. However, even Version 8, the last one, did work only with classical DOS directories, i. e., it doesn't understand LFNs (the Long File Names) added shortly after MS-DOS 6.22, so I think it's not an option anymore, although I haven't tested it to see what it does to a directory containing LFNs (but I suspect the result probably isn't pretty...). On the other hand, I've never found a newer program, LFN aware, created to fill the gap left by DE.EXE (either free or not free), and I suspect none exist. If you ever find one such program, be sure to post about it, please.

Later edit: on searching again the web, I just found the shareware LFNSORT, by Duncan Murdoch. However, it was written for Win 95, so there's no telling how well it works (if at all) on the NT-Family OSes (2k, XP, Vista and Win7) with FAT (12, 16 or 32), but it may be worth of a try (of course it doesn't work with NTFS, since it knows nothing about it). Duncan Murdoch seems to have discontinued it, since it's not listed anymore in his programs page, but the downloadable file remains available for those who know the link I posted above. For more info, please do contact Duncan Murdoch (contact info is given on his homepage). Good luck! And please keep us posted.

Share this post


Link to post
Share on other sites

Check here ;):

http://www.murraymoffatt.com/software-problem-0010.html

From a logical point of view the needed app is more a "defragger" than anything else.

http://www.smartcomputing.com/editorial/ar...6.asp&guid=

defrag /sn

Poorman's defragging described here:

http://www.msfn.org/board/msoft-uses-diske...017-page-3.html

http://kessels.biz/JkDefrag/

Now:

http://www.mydefrag.com/

http://www.mydefrag.com/Manual-UsingMyDefrag.html

Example scripts

The following scripts are provided in the "Example Scripts" folder as an example to script programmers. If you want to use one of these script from the MyDefrag chooser then copy the script to the "Scripts" folder.

...

Sort By Name

Sort all the files and directories by name, on all the fixed, mounted, writable disks on the computer.

I guess it's just a matter of adjusting the script to go on a certain volume or directory only.

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites
From a logical point of view the needed app is more a "defragger" than anything else.
I disagree: directory sorting messes just with the directory structure, while a defragger will tackle the physical location of the files also, which takes much more time. And even if one may be able to configure some deffragger to just to do a directory sorting, it seems to me akin to using an Exocet to kill a common flea.

Share this post


Link to post
Share on other sites
From a logical point of view the needed app is more a "defragger" than anything else.
I disagree: directory sorting messes just with the directory structure, while a defragger will tackle the physical location of the files also, which takes much more time. And even if one may be able to configure some deffragger to just to do a directory sorting, it seems to me akin to using an Exocet to kill a common flea.

I disagree with your disagreeing, what you say is exactly the reason why I put defragger inside double quotes, as "defragger". ;)

However, look at what I found ;):

http://web.archive.org/web/19990222003907/...net.au/~sflynn/

http://web.archive.org/web/19980703181021/...ynn/dirsort.htm

Sure it is Shareware (andf there is NO way to register it, since the homepage has disappeared) but maybe this is the "real thing".

An older version is here:

http://www.programmersheaven.com/download/3085/download.aspx

@E-66

but we are talking of DOS/Win9x or 2K/XP would be allright as well? :unsure:

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites
@E-66

but we are talking of DOS/Win9x or 2K/XP would be allright as well? :unsure:

Hi jaclaz, sorry for being late getting back to the topic. Yes, we could be talking about both 9x & XP since I use both and am frustrated by the issue with each. I went to the link you provided a few messages ago:

http://www.murraymoffatt.com/software-problem-0010.html

...and tried both the 3rd & 4th programs. I skipped the first 2 because I don't have framework 3.5 nor WMP 7 and was hoping to find a solution that would work with both OS's. The 3rd program, DriveSort, said it had no particular requirements, but it wouldn't run on my 9x system. I got an error message saying it needed MFC42U.DLL, which is apparently not a part of 9x.

I tried the 4th (last) program, FolderSort, and it worked perfectly on both systems. I just looked at the link in your last message but haven't tried it yet since FolderSort 'fixed' everything.

Ok, so FolderSort worked, but what exactly did it "do" ? Did it rearrange and "defrag" the DOS directory table?

Share this post


Link to post
Share on other sites
I got an error message saying it needed MFC42U.DLL, which is apparently not a part of 9x.

Oww, comeon is one of the Microsoft Foundation Class, most C apps need one, the MFC42U.DLL is however the Unicode NT version.

BUT ;):

http://www.mdgx.com/add.htm

OLE: Microsoft Windows 9x/NT4/2000/ME/XP/2003 Foundation Class (MFC), C Runtime + OLE Automation Libraries (DLLs) ASYCFILT.DLL, ATL.DLL, COMCAT.DLL, COMCTL32.DLL, MFC42.DLL, MFC42U.DLL, MSVCIRT.DLL, MSVCP60.DLL, MSVCRT.DLL, OLEAUT32.DLL, OLEDLG.DLL, OLEPRO32.DLL + STDOLE2.TLB Update (English):

OLE Update 5.2.3790.1830 for Windows 2003/2003 SP1: install Windows 2003 SP2.

OLE Update 3.50.5016 for Windows XP: install Windows XP SP3.

OLE Update 2.40.4530 for Windows 2000 SP4: install Windows 2000 SAFEARRAY Data Error Fix:

Direct download [810 KB].

Unofficial OLE Update 2.40.4530 + OLEAUT32.DLL 2.40.4520 for Windows 9x/NT4/ME:

Direct download [600 KB, English].

Direct download [604 KB, Italian].

Ok, so FolderSort worked, but what exactly did it "do" ? Did it rearrange and "defrag" the DOS directory table?

It re-writes the "index" of the files without rearranging the actual position of them.

When you copy a number of files the filesystem more or less does:

write an entry for File1 in the FAT

write the actual File1 in the filesystem

write an entry for File2 in the FAT

write the actual File2 in the filesystem

...

write an entry for Filen in the FAT

write the actual Filen in the filesystem

To simplify in the FAT the pointers are stored like (for the first two files):

File1->Address1/File2->Address2

And in a filesystem the files are stored like:

File1/File2/

If File1=zyzzyva.txt and File2=aardvark.txt, if you DEFRAG using a sorting algorithms you have:

To simplify in the FAT the pointers are stored like (for the first two files):

File2->Address2/File1->Address1

And in a filesystem the files are stored like:

File2/File1/

if you use one of these utilities you have:

File2->Address1/File1->Address2

And in a filesystem the files are stored like (UNchanged):

File1/File2/

jaclaz

Share this post


Link to post
Share on other sites

Thanks for the explanation of what FolderSort did, jaclaz.

I tried running DriveSort again after installing the update from MGDX's site, but no change, same error messages. I'll probably eventually end up trying it on XP, but since I already ran FolderSort on it there's nothing for it to 'fix' at this point.

Share this post


Link to post
Share on other sites
Thanks for the explanation of what FolderSort did, jaclaz.

You are welcome, though please take into account that what I described is what such a program SHOULD do, not necessarily what it does.

I mean for all we know it could well simply copy files back and forth in a given order.

If it works flawlessly under XP as dencorso reported, by instinct I doubt that it accesses filesystem structures directly. :unsure:

I guess more tests need to be made to check what it actually does.

jaclaz

Share this post


Link to post
Share on other sites

:thumbup

Hi guys!

Thanks for the info about FolderSort!!

I hade huge problems finding something that could PHYSICALLY sort the files on my memory card where I store Nintendo DS games. The issue was that the flashcard I use displays all my games in phsyical order as they are copied into the memory card.

There is (not what I am aware of) no way of displaying the game list in alphabetical order with the flash card (M3i ZERO).

FolderSort took care of this issue and it even worked on my Vista Ultimate x64 OS! So cooooooool!! :whistle:

Share this post


Link to post
Share on other sites

Happy to have contributed to yet another happy bunny. :)

jaclaz

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...