I'm looking to gather a list of all selected files in a windows explorer window.
I.E. Say I have the My Documents Folder open, and select 5 files out of say 20 in the folder, I would like to replace whatever is in the clipboard with those five entries. I created a context menu item that I can right click and run that will add whatever I have selected to the clipboard and I can make it replace or append (right now append)
The problem I am having is that Windows doesn't return those 5 items in a list (that I can find), it just runs 5 separate instances of the program, so if I replaced the clipboard when the .pl script runs, the only data in the clipboard would be whatever the last file/folder ran that was passed into the .pl script not a "list" of all 5 files/folders.
I figured out a way to get it "closer" by doing a file listing of the whole directory, and then comparing the first "section" or whatnot of the clipboard and if it doesn't contain a similar term as the file/folder listing, then it replaces the clipboard otherwise it just appends,
The problem with this is that say I ran the script in the folder once already if I go back to that same folder without clearing the clipboard initially or putting something else on the clipboard, it won't realize that it needs to replace the contents and will continue to append, which then it will contain more items then I want,
This problem has been bugging me and I can't think of a good solution to it. If there is a way to get a "list" of all the selected files this would be SIMPLE but I can't figure that out.
Does someone know how I can get a list of the files selected?