October 6, 200817 yr Hi, I want to make a batch script which takes a file name which comes in this format:MonthDayYearHoursMinutesSecondsAM/PM.pdfand renames it toYearMonthDayHoursMinutesSecondsAM/PM.pdfFor example:09302008092212AM.pdf -> 20080930092212AM.pdfI am hoping I can use the for command to do this somehow. Maybe someone can tell me if I can use "2 characters" as a delimeter, that way I could split it into 09 30 20 08 09 22 12 AM .p df and rearrange.Any help would be highly appreciated,Thanks
October 6, 200817 yr Here's an example of variable expansion, (see SET /?), which should help you out!@Echo off&SetlocalSet "_=09302008092212AM.pdf"Set "_=%_:~4,4%%_:~0,4%%_:~8%"Echo:%_%&Pause
Create an account or sign in to comment