How to select many files and copy to 2 locations

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
omar
Posts: 540
Joined: 22 Oct 2015, 17:56

How to select many files and copy to 2 locations

06 Dec 2021, 19:47

In Windows Explorer, I want to select a few files.
I then want to make a keyboard shortcut that copies these files to 2 different locations.

Copying 1 file using AHK - I can look up the documentation.
But wasn't sure how I would do multiple?

+ What would I do about error reporting?
Like what to do if the file exists, or just there was a problem copying (like the file was locked by Excel for example).

I guess I can get a DOS solution and then use AHK to call the batch file? But surely there is a 'pure' AHK way to do it?

Thanks.
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: How to select many files and copy to 2 locations

06 Dec 2021, 20:15

Indeed, AHK has a :arrow: FileCopy command that includes an ErrorLevel. See documentation.

See function to get the Explorer selection, too-- includes multiple files. Example
omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Re: How to select many files and copy to 2 locations

06 Dec 2021, 22:01

oooh very nice! :bravo:
So the magic happens in the function Explorer_GetSelection() you made?
I'll give it a try tmrw.
Thanks.

+ Thanks for being a star - you always answer loooads of questions I post. :clap:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, nacken012 and 229 guests