Assume I have (simplified) three files in a directory:
111.txt
222.txt
333.txt
Now I click and mark (step by step) the files in the sequence 333.txt then 111.txt and finally 222.txt
Afterwards I dragged the three marked files on a DOS batch shortcut on desktop for further processing.
Unfortunately the order of the files in parameter list is different to the order in which I clicked them. Here it is:
222.txt then 333.txt then 111.txt
Hmm, how can I achieve that the sequence of the files in the parameter list is equal to the sequence in which I clicked (=marked) them in WindowsExplorer?
Peter
How to pass params (=files) in the order I clicked them in Winexp?
Moderator: DosItHelp
Re: How to pass params (=files) in the order I clicked them in Winexp?
This is not possible.
The reason is that the receiving process (the cmd.exe process where your script is running in) doesn't get any information about the order you marked the files. The explorer.exe process puts the file paths to the data transfer interface and the order that explorer.exe used is the order you receive it. This order is dependent on the column you used to sort files in the explorer list view. E.g. if you ordered the files by the date in the list view then you receive the files ordered by date, too.
Steffen
The reason is that the receiving process (the cmd.exe process where your script is running in) doesn't get any information about the order you marked the files. The explorer.exe process puts the file paths to the data transfer interface and the order that explorer.exe used is the order you receive it. This order is dependent on the column you used to sort files in the explorer list view. E.g. if you ordered the files by the date in the list view then you receive the files ordered by date, too.
Steffen
Re: How to pass params (=files) in the order I clicked them in Winexp?
Are you sure about this? I have a fair amount of experience seeing this issue, but only when sorting by name, and files definitely don't come through sorted by name.
Re: How to pass params (=files) in the order I clicked them in Winexp?
Right now I tried again. It behaves as I said. Win10 64 Bit.
Just to make sure it's not dependent on the file system I tested on an NTFS and a FAT32 formatted drive with the same results.
What do you recommend to reproduce the different behavior you've seen?
Steffen
Just to make sure it's not dependent on the file system I tested on an NTFS and a FAT32 formatted drive with the same results.
What do you recommend to reproduce the different behavior you've seen?
Steffen
Re: How to pass params (=files) in the order I clicked them in Winexp?
I did some heavy testing on this about 10 years ago. It also depends on which file you grab when you drag the files.
You can select file 3, 2 and 1, but if grab file 2 with your mouse, they will output as 2, 3 and 1.
So essentially they will output in sorted order starting with the file you grabbed and then loop back to the top with any files left over in sorted order. I can confirm that it does use the column that Windows Explorer has the files sorted on as well.
You can select file 3, 2 and 1, but if grab file 2 with your mouse, they will output as 2, 3 and 1.
So essentially they will output in sorted order starting with the file you grabbed and then loop back to the top with any files left over in sorted order. I can confirm that it does use the column that Windows Explorer has the files sorted on as well.