sternkanz Posted October 6, 2008 Posted October 6, 2008 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
Yzöwl Posted October 6, 2008 Posted October 6, 2008 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
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now