I cannot figure out how to separate files into folders by date.
I have 1,000,000 files and all files in 1 folder is making Explorer sick 😛
so I want to separate them into different folders by date:
01-09-11
02-09-11
03-09-11
etc.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Extracting the file date is relatively easy, see
HELP CALLand try this simple BAT fileTo move beyond this approach into a solution to your problem seems pretty straightforward…
but, wait, that code is not guaranteed to run. There are some dependencies on the date format that may prevent this simple code to run. Handling of dates in BAT file is not easy, because date format depends on locale and even on custom preferences. In this particular piece, it will play havoc in case the date separator is
/, for example; or if the date format uses two digits for the year instead of four digits, making the date to fill only 8 positions instead of 10… The variations on format and thus the possible bugs of this code are endless.One possible solution is to momentarily change the date format to a known format. Insert this code before the loop
and then, back to original, after the loop.