...looking for something where I select a file, a folder, and it automatically swaps the files in the selected folder with a duplicate of the selected file.
You can use
AutoIt. You only need to install AutoIt from that link. Use the default selections during the installation. You don't need the full customized editor - unless you start creating your own scripts from scratch. You should test the code below using a
copy of the settings files in a
test folder.
Create a new text file somewhere. Copy/paste/save the code below into that text file. Change the file extension on that file from TXT to AU3. Right click on that file and select
Edit Script from the context menu.
Here is the code that you will want to
change:
$Initial_Folder = "
C:\Temp\"
Change the folder to whatever you want it to be. That will be the folder that the File Open Dialog boxes starts in. You can always navigate to other folders - if desired.
$source = FileOpenDialog("Select the source file", $Initial_Folder, "
Text files (*.txt)")
$destination = FileOpenDialog("Select all of the destination files", $Initial_Folder, "
Text files (*.txt)", 4)
Change the
filter to describe the settings files and to indicate the file extension.
Save the changes. [See the notes after the code box.]
Run the script by double clicking on the AU3 file. [Or from within SciTE.]
You do not need to compile the script.
When running:
Select the file to be copied (source file) via the first File Open Dialog box - then click on
Open.
Select all of the files to be copied over (destination files) via the second File Open Dialog box - then click on
Open.
It does not matter if you happen to select the source file when selecting the destination files. Ctrl + A might work for you to select the destination files. Click/drag should also work when selecting the destination files.
The script only halts if the file copy fails.
For 15 file copies, you should see the final message box in less than a second.
Code:
AutoItSetOption ("TrayIconDebug", 1)
$Initial_Folder = "C:\Temp\"
$source = FileOpenDialog("Select the source file", $Initial_Folder, "Text files (*.txt)")
$destination = FileOpenDialog("Select all of the destination files", $Initial_Folder, "Text files (*.txt)", 4)
$destination_Array = StringSplit($destination, "|")
For $i = 2 to $destination_Array[0]
If FileCopy($source, $destination_Array[$i], 1) = 0 Then
MsgBox(0, "error", "The file copy failed for " & $destination_Array[$i])
Exit
EndIf
Next
MsgBox(0, "", "Done")
Notes - the steps above should make use of the light version of the SciTE script editor that comes with the AutoIt install. After making edits to the script, you might want to select
Tools from that editor's Menu Bar and then select
SyntaxCheck Prod. Doing that should save any changes and check the code for errors. If there are no errors, the the script can be run from within the SciTE script editor via
Tools >
Go (or F5).