sternkanz Posted October 6, 2008 Share 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 Link to comment Share on other sites More sharing options...
Yzöwl Posted October 6, 2008 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now