Sort file names literally instead of numerically — via Microsoft Learn
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:00000001Undo
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 /fUndo:
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStrCmpLogical" /fMicrosoft's example: enabled sorts 111 < 22 < 3; default sorts 3 < 22 < 111. The policy also exists under Computer Configuration for all users.
Sources
- ADMX_WindowsExplorer Policy CSP — by Microsoft Learn
- Administrative Templates (.admx) for Windows 11 2025 Update (25H2) — ADMX policy definitions — by Microsoft
- 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.