locked
How to Change the Sort Order for Numbers in File and Folder Names (In Win7 RC) RRS feed

  • Question

  • In Windows 2000 file names were sorted as:

    11.txt
    5.txt
    88.txt

    In Windows Vista, Windows XP, and Windows Server 2003 the default sorting is:
    5.txt
    11.txt
    88.txt

    Ref http://support.microsoft.com/kb/319827

    It was possible to change the sorting order for numbers in file and folder names, by defining NoStrCmpLogical=1 in HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer


    I have named a lot of pictures as “YYYY.MM.DD. – Subject”. Sometime I name it “YYYY – Subject” (depending on how much information I have about the date). If I don’t know the year I name it “YYYx – Subject” (YYYx means the last digit is unknown – ex “196x – Subject” if the picture is from the period 1960-1969). The problem is the new sorting which list files named 196x before 1900 (as Win7 thinks I want it sorted as number 196 and not as ASCII strings).

    Does somebody knows how to change the sort order in Win7 RC (64 bit). I have tried the registry hack for Vista, but no success.

    Any solution is welcome….

    Regards
    Harald

    • Edited by Haral Wednesday, June 24, 2009 10:33 PM
    Wednesday, June 24, 2009 10:30 PM

Answers

  • Sorry to bother you – but I have found the solution. I had not tested enough.

    In XP I used this REG file:

    REGEDIT4

     

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\List Order]

    "Type"="checkbox"

    "Text"="Sort file lists as text instead of number values"

    "ValueName"="NoStrCmpLogical"

    "CheckedValue"=dword:00000001

    "UncheckedValue"=dword:00000000

    "DefaultValue"=dword:00000000

    "RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"

    "HKeyRoot"=dword:80000001

     

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

    "NoStrCmpLogical"=dword:00000000

     

    In XP this reg file creates a checkbox where the “sorting option” can be switched on/off (in “Tools | Folder Options | View”). This work grate and it did exactly what I wanted.

    When I used the Reg-file on Win7 RC, nothing happened. I can select (Tick on/off) but nothing happens as in XP. Then I conclude wrong that the "NoStrCmpLogical" setting did not work in Win 7 RC.

     

    The problem is that the “switching” system does not work in Win7. But when I set the registry value, Win7 / Explorer work exactly as wanted.

     

    Sorry to bother you about this – but I have learned even more……

     

    • Marked as answer by Haral Thursday, June 25, 2009 8:57 PM
    Thursday, June 25, 2009 8:56 PM

All replies

  • At the top right of the window's tool bar, should be innermost icon, is the change your view. Go to your pictures library or folder and try it. Change the view to please your needs.

    OK?
    Wednesday, June 24, 2009 11:23 PM
  • Hi Nano Warp

    Thanks for responding. As I can see this only switch between different views of the file names (Details, List, Tiles, Content etc). This will not change the sorting of the file names.

    Somebody with other suggestions?
    Thursday, June 25, 2009 12:01 AM
  • The list view has a different effect with the Libraries>Pictures and Computer>C:/ User Name>Pictures folder.

    The Libraries are a new feature for quick access. Try that. 

    I can replicate your situation in the Libraries>Picture.
    Thursday, June 25, 2009 12:09 AM
  • When you click on the column header in the Libraries>Picture folder it resorts by that information. Does that help?
    Thursday, June 25, 2009 12:17 AM
  • This is what is known as "intuitive filename sorting", as opposed to literal.  With XP, you could use TweakUI to change this.

    In Vista, it could probably be changed with TweakVI, available from NeoSmart Technologies, but your registry hack works just as well.

    Since this is in Policies, I expected to find something it in Group Policy, at least on Windows 2003 Server.  But I could not find anything.  On Server 2003, I see the setting under HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. NoStrCmpLogical is REG_BINARY, 0x0000.
    Thursday, June 25, 2009 12:45 AM
  • Sorry to bother you – but I have found the solution. I had not tested enough.

    In XP I used this REG file:

    REGEDIT4

     

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\List Order]

    "Type"="checkbox"

    "Text"="Sort file lists as text instead of number values"

    "ValueName"="NoStrCmpLogical"

    "CheckedValue"=dword:00000001

    "UncheckedValue"=dword:00000000

    "DefaultValue"=dword:00000000

    "RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"

    "HKeyRoot"=dword:80000001

     

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

    "NoStrCmpLogical"=dword:00000000

     

    In XP this reg file creates a checkbox where the “sorting option” can be switched on/off (in “Tools | Folder Options | View”). This work grate and it did exactly what I wanted.

    When I used the Reg-file on Win7 RC, nothing happened. I can select (Tick on/off) but nothing happens as in XP. Then I conclude wrong that the "NoStrCmpLogical" setting did not work in Win 7 RC.

     

    The problem is that the “switching” system does not work in Win7. But when I set the registry value, Win7 / Explorer work exactly as wanted.

     

    Sorry to bother you about this – but I have learned even more……

     

    • Marked as answer by Haral Thursday, June 25, 2009 8:57 PM
    Thursday, June 25, 2009 8:56 PM
  • Thank you for the knowledge. It should be easier than this or the code writers can only work with literal sorting. :-)
    Thursday, June 25, 2009 9:57 PM
  • Haral,
    I found this on a different thread-Master the new search 4.0-it may further assist you-some wanted to simply find their .iso file and search gave them garbage.

    "Mastering the new search is not for the faint of heart. I guess they tried to make it useful for....I don't know who they tried to make it useful for. I doubt it was programmers and yet those are the only people to whom it makes sense. And I guess if you are one, then the new search is indeed way more powerful if too complex and inefficient for simple file-searches.

    There is no point in searching using old style wildcard syntax, returned results are rarely anything but irrelevant garbage. What you need to do, like it or not is to get on board because that train is leaving the station and ain't coming back.

    Following page gives some rather detailed insight into the matter:


    I don't know why MS does not put a hot-link to that page somewhere within the Search-box or when you press F1 while in it, it would help tremendously and save people a lot of (unnecessary) aggravation.

    To give a direct answer to the OP, your search should actually be ext:iso or file:*.iso. Then you would get your list of ISO files. Otherwise, "*.iso" returns all occurrences within ALL metadata properties, which can obviously be more than just the filename. The AQS is extensive and it is a lot to remember.

    On the visuals, it would be nice of MS to let us add our own Quick Filter sets for speedy access instead of the only two Date Modified: and Size: (sure, whatever). I'd love to have a File: and Ext: there instead which would save me time by not having to type that in every time - maybe it can be hacked, I dunno."

    Regards,
    Carl
    Monday, June 29, 2009 12:06 PM
  • I too start my picture names off using the ISO 8601 numeric representation of date and time.  I have relied on Tweak UI to make the change as I moved around to different computers.  Knowing the registry change will "save my life" as I move on to operating systems newer than XP.  Better File Rename - available at www.PublicSpace.net/Windows/BetterFileRename/
    allows changing all or part of filenames in batches.  It can even read the seconds field from the Date Picture Taken meta data the camera includes with the files it makes.
    Thursday, December 3, 2009 10:32 PM
  • For my Vista machine I have found three Registry entries that affect this. Open Regedit and search "NoStrCmpLogical". Every "HKEY_USERS" key will be different.
    --
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoStrCmpLogical"=dword:00000001

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoStrCmpLogical"=dword:00000001

    [HKEY_USERS\S-1-5-21-123456789-1234567890-1234567890-1234\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
    "NoStrCmpLogical"=dword:00000001

    --
    Rick
    Tuesday, January 5; 11:00 AM (CT)
    Tuesday, January 5, 2010 4:59 PM
  • Hi John,

    Start=>Help and Support=> search Change sort order

    An interesting feature is to :

    To group your files by property

    1. Open the folder or library that you want to group.

    2. Right-click an empty space, point to Group by, and then click a property (such as Type).

    3. If you don't see the property you're looking for in the Group by menu, click More to add properties.

    If you want to remove the grouping separation in a folder or library, just right-click an empty space, point to Group by, and then click (None).

     

    While there, select a sort property to highlight it, then the move up\move down buttons are active to set the priority.

    I created new folders named 1966.12.03,1967.05.10,1968.06.05, 1900.02.03 (as in original posters example) and it sorted them by the year first after moving the number # property to first on the list.

    So, I believe that you should be able to create a sort order that suits your needs.

    Friday, April 9, 2010 3:34 AM
  • No Nano Warp, you see, this set of file names will be sorted the same way no matter what kind of number sorting approach is used. You will find the original poster's example filenames include initial numbers _of different length_ (measured in number of digits). Thus one can either sort by the size of the number or by the value of the first digit. 

    The "#" column you write of cannot be used for sorting files apparently, it might correspond to some strange property of some equally strange class of files. The methode described does at least not do what you claim it does. Also, moving things up and down in the list changes the geographical placement of the corresponding column, not its sort priority.

    A possible solution I haven't tested yet but intend to, at http://maximumpcguides.com/windows-7/turn-off-numerical-sorting-in-windows-explorer/. My need for this is to usefully sort sha1 filenames.

    Tested on Server 2008 R2 SP1, it works perfectly.
    • Edited by Eroen Thursday, May 19, 2011 8:18 PM This forum isn't threaded but claims to be.
    • Proposed as answer by Eroen Thursday, May 19, 2011 8:24 PM
    Thursday, May 19, 2011 8:17 PM
  • Do you expect folders to be alphabetically sorted by name?  It doesn't.  I have folder sorted  as

    2012-04

    2012-05

    2012-0314

    It won't sort as it should

    2012-0314

    2012-04

    2012-05

    Windows has some strange sorting scheme.  It seems like a bug.

    Monday, October 22, 2012 8:10 AM