Hi there please I need some help with writing a .bat script so that I can create multiple folders according to the files name. For example: Hext-2020_L2065068_D(2012)1116084531_U605_.au
I need it to create a folder according to the year (above in brackets)
Hext-2020_L2065068_D2012(11)16084531_U605_.au
A sub folder inside the "year folder" with the month (above in brackets)
Hext-2020_L2065068_D201211(16)084531_U605_.au
And lastly to create yet another sub-folder in the "month" for the day (above in brackets)
And lastly copy the files into the appropriate folder so that the folder structure would look like this
2012\11\16\Hext-2020_L2065068_D201211(16)084531_U605_.aufor the above file name
Please any help would be appreciated
@echo off & setlocal enabledelayedexpansion
for /f "tokens=1-2* delims=_" %%a in ('dir /b *.au') do (
set d=%%c
set d1=!d:~1,4!\!d:~5,2!\!d:~7,2!
md !d1!
copy %%a_%%b_%%c !d1!\
)
Thank you so much it works perfectly just changed the "copy" to "move" thanx
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |