Sort order for bat file is wrong for dir /o:n

  batch-file, cmd, command, scripting, windows

I am getting wrong order while sorting "dir /o:n"

 D:Softwarestry>dir /o:n
 Volume in drive D is Data
 Volume Serial Number is 3C9A-F8CE

 Directory of D:Softwarestry

15-01-2022  11:06    <DIR>          .
15-01-2022  11:06    <DIR>          ..
14-01-2022  18:46         4,433,620 1 (1).mp4
14-01-2022  18:46         2,044,557 1 (10).mp4
14-01-2022  18:46         3,576,246 1 (11).mp4
14-01-2022  18:46         4,023,351 1 (12).mp4
14-01-2022  18:46         2,310,852 1 (13).mp4
14-01-2022  18:46         2,070,010 1 (14).mp4
14-01-2022  18:46         3,607,915 1 (15).mp4
14-01-2022  18:46         3,250,464 1 (16).mp4
14-01-2022  18:46         2,375,340 1 (17).mp4
14-01-2022  18:46         2,018,536 1 (18).mp4
14-01-2022  18:46         2,902,276 1 (19).mp4
14-01-2022  18:46         4,451,522 1 (2).mp4
14-01-2022  18:46         4,477,760 1 (20).mp4

It is supposed to come

14-01-2022  18:46         4,433,620 1 (1).mp4
14-01-2022  18:46         2,044,557 1 (2).mp4
14-01-2022  18:46         3,576,246 1 (3).mp4
14-01-2022  18:46         4,023,351 1 (4).mp4
14-01-2022  18:46         2,310,852 1 (5).mp4

But it is coming Like in the below order

14-01-2022  18:46         4,433,620 1 (1).mp4
14-01-2022  18:46         2,044,557 1 (10).mp4
14-01-2022  18:46         3,576,246 1 (11).mp4
14-01-2022  18:46         4,023,351 1 (12).mp4
14-01-2022  18:46         2,310,852 1 (13).mp4

Source: Windows Questions

LEAVE A COMMENT