How to pass params (=files) in the order I clicked them in Winexp?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 125
Joined: 09 Nov 2011 01:42

How to pass params (=files) in the order I clicked them in Winexp?

#1 Post by pstein » 17 Nov 2018 10:28

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to pass params (=files) in the order I clicked them in Winexp?

#2 Post by aGerman » 17 Nov 2018 11:04

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

kwsiebert
Posts: 43
Joined: 20 Jan 2016 15:46

Re: How to pass params (=files) in the order I clicked them in Winexp?

#3 Post by kwsiebert » 19 Nov 2018 11:26

aGerman wrote:
17 Nov 2018 11:04
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.
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.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to pass params (=files) in the order I clicked them in Winexp?

#4 Post by aGerman » 19 Nov 2018 12:08

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

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: How to pass params (=files) in the order I clicked them in Winexp?

#5 Post by Squashman » 19 Nov 2018 12:18

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.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to pass params (=files) in the order I clicked them in Winexp?

#6 Post by aGerman » 19 Nov 2018 14:35

Squashman wrote:
19 Nov 2018 12:18
It also depends on which file you grab when you drag the files.
Oh, I didn't realize that but I can absolutely confirm.

Post Reply