Thanks to help from above... This is what I am using:
C:\Windows\System32>SET short=%date:~10,4%-%date:~4,2%-%date:~7,2% C:\Windows\System32>ECHO -- Short Date: %short% -- Short Date: 2018-06-27 C:\Windows\System32>SET long=%date:~10,4%-%date:~4,2%-%date:~7,2%%time:~0,2%%time:~3,2%_%time:~6,2% C:\Windows\System32>ECHO -- Long Date: %long% -- Long Date: 2018-06-27_10_51_43
C:\Windows\System32>SET short=%date:~10,4%-%date:~4,2%-%date:~7,2% C:\Windows\System32>ECHO -- Short Date: %short% -- Short Date: 2018-06-27 C:\Windows\System32>SET long=%date:~10,4%-%date:~4,2%-%date:~7,2%_%time:~0,2%_%time:~3,2%_%time:~6,2% C:\Windows\System32>ECHO -- Long Date: %long% -- Long Date: 2018-06-27_10_51_43 I then have logs that are called out in Robocopy jobs like this:
There are many like this: Robocopy C:\Users\ME\Favorites\ %usb%:\Local_PC\Favorites\ /MIR /TEE /FFT /DST /TIMFIX /W:5 /R:5 /NP /LOG+:%usb%:\Robocopy\LOG_%short%.txt
Robocopy C:\Users\ME\Favorites\ %usb%:\Local_PC\Favorites\ /MIR /TEE /FFT /DST /TIMFIX /W:5 /R:5 /NP /LOG+:%usb%:\Robocopy\LOG_%short%.txt Ends job with this: REN %usb%:\Robocopy\LOG_%short%.txt COMPLETE_LOG_%long%.log
REN %usb%:\Robocopy\LOG_%short%.txt COMPLETE_LOG_%long%.log "COMPLETE_LOG_2018-06-27_10_53_54.log"COMPLETE_LOG_2018-06-27_10_53_54.log is the file produced at the end and it is sortable by file name.