Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set filename=20150504_144132.mp4
- set filepath=c:Temp%filename%
- REM get the date from the file name
- for /f "delims=." %%A in ("%filename%") do set fdate=%%A
- REM Y=YEAR; M=MONTH; D=DAY
- set Y=%fdate:~0,4%
- set M=%fdate:~4,2%
- set D=%fdate:~6,2%
- REM echo %Y% %M% %D%
- if "%M%" == "01" set Mo=January
- if "%M%" == "02" set Mo=February
- if "%M%" == "03" set Mo=March
- if "%M%" == "04" set Mo=April
- if "%M%" == "05" set Mo=May
- if "%M%" == "06" set Mo=June
- if "%M%" == "07" set Mo=July
- if "%M%" == "08" set Mo=August
- if "%M%" == "09" set Mo=September
- if "%M%" == "10" set Mo=October
- if "%M%" == "11" set Mo=November
- if "%M%" == "12" set Mo=December
- REM echo %Mo%
- REM get the time from the file name
- for /f "delims=." %%A in ("%filename%") do set ftime=%%A
- REM H=HOUR; Mi=MIN; S=SEC; E=Ext
- set H=%ftime:~9,2%
- set Mi=%ftime:~11,2%
- set S=%ftime:~13,2%
- REM echo %H% %Mi% %S%
- REM check to see if directories exist
- if not exist V:%Y% mkdir V:%Y%
- if not exist V:%Y%%Mo% mkdir V:%Y%%Mo%
- if not exist V:%Y%%Mo%%D% mkdir V:%Y%%Mo%%D%
- REM copy the file to the newly created destination folder
- move %filepath% V:%Y%%Mo%%D%%H%"-"%Mi%"-"%S%.mp4
Add Comment
Please, Sign In to add comment