Discussion forum for all Windows batch related topics.
2 posts • Page 1 of 1
I am wanting to have a .bat file make a copy of 3 directories. I want it to make a directory with the day's date in and copy the 3 other directories into it. I want all 3 directories to keep their separate file trees. How do I do this?
Something about like that
Code: Select all
@echo off &setlocal for /f %%i in ('WMIC OS Get LocalDateTime /value') do for /f %%j in ("%%i") do set "%%j" robocopy "dir1" "%LocalDateTime:~0,8%\dir1" /e /r:0 /w:0 robocopy "dir2" "%LocalDateTime:~0,8%\dir2" /e /r:0 /w:0 robocopy "dir3" "%LocalDateTime:~0,8%\dir3" /e /r:0 /w:0