Skip to content

Sort file names literally instead of numerically — via Microsoft Learn

Group Policylow riskProEnterpriseEducationWindows 11Windows 10

Explorer sorts "file2" before "file10" because it reads numbers as values. Some people (and some build scripts) want plain character order instead: file10, file2. This Microsoft policy switches Explorer to literal sorting.

Sign out and back in

Group Policy

Open gpedit.msc (Pro, Enterprise and Education only) and go to:

User Configuration > Administrative Templates > Windows Components > File Explorer > Turn off numerical sorting in File Explorer

Registry equivalent

Double-click a .reg file and confirm to merge it. Right-click → Edit first if you want to read it, which is always a good idea with any .reg file from the internet.

Apply

Windows Registry Editor Version 5.00

; Oddbyte.Me: Sort file names literally instead of numerically

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoStrCmpLogical"=dword:00000001

Undo

Windows Registry Editor Version 5.00

; Oddbyte.Me: undo Sort file names literally instead of numerically

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoStrCmpLogical"=-

Same thing from a command prompt

Run in a normal (non-admin) Command Prompt or Terminal.

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStrCmpLogical" /t REG_DWORD /d 1 /f

Undo:

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStrCmpLogical" /f
Microsoft's example: enabled sorts 111 < 22 < 3; default sorts 3 < 22 < 111. The policy also exists under Computer Configuration for all users.

Sources

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.

sortingnumerical sortfile namesexplorerpolicy

More in File Explorer