We have a lot of files that have various dates appended to them. For Example, File_LocB_101108.txt. I want to archive those files based upon the last 6 characters this is always a date. I found this code which it seems will work but how do you get the last six characters instead of the first five??
if not "%~1"=="" set startDir=%~1
for /f "tokens=*" %%a in ('dir /b /a-d 2^>NUL') do call :PROCESS "%%a"
if not exist "%dirName%" echo Creating %dirName%&mkdir "%dirName%"
(echo Moving %~1 to %dirName%)
move "%~1" "%dirName%">NUL
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.