Batch file rename and copy

Aug 6, 2008
Reaction score

I've gone through the forums and I was able to get some help that way from previous threads. I've got a batch file that appends the year, month, and day on it. It then moves it to another folder after processing.

I need it to add the minutes and seconds on there as well, and I can't seem to get the right code for it.

 @Echo Off
 @For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(
 Set Month=%%A
 Set Day=%%B
 Set Year=%%C
 Set All=%%C%%A%%B
 @For %%a in ("*.tif") do copy %%a "C:\Testdate\%%~na_%All%.tif"

Also, I'm not sure if this is even possible with batch files but is there a way to incorporate a statement that checks the file name and then moves it to a different folder depending on if it contained specific characters? Like GE08-1234, I would want in one folder, and then HHI08-1234 in a different one.

Thank you very much for the help!

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question