Processing a group of files at a time in a single folder
Posted: 03 Jan 2012 23:36
Hi Guys,
I'm wanting to process approximately 20 random files in a single folder so that they are rar'ed (compressed using the 3rd party rar.exe command) in groups of 5 files, making for a total of 4 rar files (rar1.rar, rar2.rar, rar3.rar and rar4.rar), containing all of the 20 files. Ideally I want to be able to rar the first 5 files in the folder, perform a move of that rar file and then move onto the next 5 files to be rar'ed, and then repeat until there are no more files left.
I'm a bit stumped at the moment on where to start. I'm able to rar multiple files at a time, I'm just not sure how to rar the first 5 files and then move onto the next 5 and so on, until finished. I'm guessing some sort of FOR /F loop is required?
I haven't been able to find any example code either. Can anyone point me in the right direction? Let me know if I need to clarify anything.
I'm wanting to process approximately 20 random files in a single folder so that they are rar'ed (compressed using the 3rd party rar.exe command) in groups of 5 files, making for a total of 4 rar files (rar1.rar, rar2.rar, rar3.rar and rar4.rar), containing all of the 20 files. Ideally I want to be able to rar the first 5 files in the folder, perform a move of that rar file and then move onto the next 5 files to be rar'ed, and then repeat until there are no more files left.
I'm a bit stumped at the moment on where to start. I'm able to rar multiple files at a time, I'm just not sure how to rar the first 5 files and then move onto the next 5 and so on, until finished. I'm guessing some sort of FOR /F loop is required?
I haven't been able to find any example code either. Can anyone point me in the right direction? Let me know if I need to clarify anything.