LabVIEW Recursive File List VI Return Different Sequences of Files in Different Windows Versions

Updated Aug 14, 2023

Reported In

Software

  • LabVIEW

Operating System

  • Windows

Issue Details

When I execute Recursive File List VI in Windows XP, the file will be sorted as below.

1.txt
11.txt
2.txt

But when I execute Recursive File List VI in Windows 10 and above, the returned file sequences are different than the one in Windows XP as per below sequences.

1.txt
2.txt
11.txt

Why the same Recursive File List VI function returned different file sequences in different versions of Windows?

Solution

This is expected behavior because in Windows XP, the file will be sorted in literal order. While in Windows 10 and above, the default setting is file explorer will sort the file according to numerical order. You can read the details and how to enable or disable numerical order sorting in the Related Links section.

You can edit the Windows registry to disable numerical order sorting.

If you cannot change the registry to disable numerical order sorting, you can create a logic to sort the file based on the file name. You can refer to the community example in the Related Links section.