The idea of the script (below) is to read a .txt file, display the folder properties of the copied folder within "testfolders1" and "testfolders2" to confirm size of transfer (different script that I've already created that works), then delete the respective folder from "testfolders1" upon clicking "Yes" through a Gui button and continuing to the next step, or force stopping if no is selected.
I am running into an issue where the script just freezes upon clicking "Yes" and will not progress. I thought this was just due to the folder deleting taking time, but I've left it running for 30 minutes on a folder that is only 1 MB.
Something additional that I am attempting to do, is upon completion of the deletion of the folder, I want the line deleted from the textfile (you'll see where I attempt to call it out in the code). I would also like to allow multiple instances of a transfer to run if the file has more than 5 folders to delete. With the code I have below, it will only allow one folder to be deleted at a time, and I would like to set it to have up to 5-10 transferring at a time, if possible. I'm just unsure of how to code the simultaneous deletions.
Here is the code I've written:
Code: Select all
#singleinstance force
Loop, read, C:\Users\deshone\Desktop\AHK\File.txt
{
Loop, parse, A_LoopReadLine, `n
{
Gui, Font, s14
Gui, Add, Text,, Confirm Deletion for %A_LoopField%?
Gui, Font, s10
Gui, Add, Button, x70 y40, Yes
Gui, Add, Button, x180 y40, No
Gui, Show
Run, properties "C:\Users\deshone\Desktop\AHK\testfolders1\%A_LoopField%"
Run, properties "C:\Users\deshone\Desktop\AHK\testfolders2\%A_LoopField%"
sleep 60000
ButtonNo:
Gui, Hide
MsgBox, No has been clicked or session timed out - STOPPING SCRIPT.`nPlease reload script when ready.
exitapp
return
ButtonYes:
Gui, Hide
Progress,%a_index%,%a_LoopField%
FileRemoveDir, C:\Users\deshone\Desktop\AHK\testfolders1\%A_LoopField%, 1
%a_LoopField% = ""
return
GuiClose:
ExitApp
}
}
Thanks!
etdeshon