@echo off & setlocal EnableDelayedExpansion set "originalFile=C:\Files\Cheese.txt" set "backupFolder=C:\Backup" set /p "backupName=Enter backup name: " set "backupName=%backupName%" echo. REM Windows Environmental Variables for time and date respect whatever format is set in Control Panel REM However we can guarantee a specific format by determining date and time via WMIC for %%t in (year month day hour minute) do ( for /f %%a in ('wmic path win32_localtime get %%t ^| Findstr .') do ( set "%%t=%%a" ) REM Add leading zeros if required if !%%t! LSS 10 set "%%t=0!%%t!" ) set "dateTime=%year%%month%%day%-%hour%%minute%" set "backupPath=%backupFolder%\%dateTime%-%backupName%" echo %backupPath% md "%backupPath%" 2>nul copy /y "%originalFile%" "%backupPath%\" echo. pause