%time% zawiera znaki : (dwukropek), które nie można użyć w nazwie ścieżki, można wykonać coś na wzór substring stosowany w wielu językach programowania
@ECHO off
SET time_to_string=%time:~0,2%-%time:~3,2%-%time:~6,2%
ECHO %time_to_string%
SET time_to_string=%time:~0,8%
SET time_to_string=%time_to_string::=-%
ECHO %time_to_string%
SET time_to_string=%time:~0,8%
SET time_to_string=%time_to_string::=%
ECHO %time_to_string%
SET h=%time:~0,2%
SET m=%time:~3,2%
SET s=%time:~6,2%
IF %h% LSS 10 SET h=0%time:~1,1%
SET time=%h%%m%%s%
ECHO %time%
ECHO.
PAUSE
SET h=%time:~0,2%
SET m=%time:~3,2%
SET s=%time:~6,2%
IF %h% LSS 10 SET h=0%time:~1,1%
SET time=%h%%m%%s%
MKDIR C:\Backup\Backup_%date%_%time%