101
Post New Requests Here / Re: Move/Organize Files Into Folders
« on: March 26, 2016, 09:48 AM »
I don't know if you are familiar with AutoHotkey, a useful script language, you can find it here http://autohotkey.com/
This script should work (be sure to make a backup and be careful which folders you use)
The DIR command (MS Dos) has a useful SORT by size option so we make use of that to create a list of files sorted by size first, then read the list and parse it and create the folders when we need them to move the files into it. Again use at your own risk and be careful which folders you try it out on. You can compile this script into a exe and also have it read some settings from an INI file if that is useful by using the AutoHotkey IniRead command. You can also dress it up with a GUI and progress bars and what not, this is just a bare bones script.
This script should work (be sure to make a backup and be careful which folders you use)
The DIR command (MS Dos) has a useful SORT by size option so we make use of that to create a list of files sorted by size first, then read the list and parse it and create the folders when we need them to move the files into it. Again use at your own risk and be careful which folders you try it out on. You can compile this script into a exe and also have it read some settings from an INI file if that is useful by using the AutoHotkey IniRead command. You can also dress it up with a GUI and progress bars and what not, this is just a bare bones script.
Code: Autohotkey [Select]
- #SingleInstance, force
- Counter:=0
- FilesPerFolder:=100
- Folder=c:\test\ ; set folder here or uncomment the lines below by removing the ; so you can select a folder
- ;FileSelectFolder, Folder, , 0, Select folder
- ;If (Folder = "")
- ; ExitApp
- ; make a list sorted by size, type DIR /? at a command prompt for more options.
- RunWait, %ComSpec% /c dir %Folder% /b /OS > $$filelistsortedbysize.tmp, , Hide ; use /O-S if you want to sort from large to small
- Sleep 100
- {
- ; MsgBox %Folder%\%A_LoopField%`n%Folder%\%TargetFolder% ; debug msgbox so we can see what is going on
- {
- }
- }
- MsgBox Done!
- ; Esc::ExitApp ; if you want to be able to stop the script at any time by pressing Esc remove the ;