Code: Select all
:: 2. Create new backup set
set bkuphour=%time:~0,2%
if "%bkuphour:~0,1%"==" " set bkuphour=0%time:~1,1%
set bkupfldr=%date:~10,4%-%date:~4,2%-%date:~7,2% %bkuphour%-%time:~3,2%
echo+
echo CREATING FOLDER %BackupTarget2%%bkupfldr%\
if not exist "%BackupTarget2%%bkupfldr%\" mkdir "%BackupTarget2%%bkupfldr%\"
echo+
echo BACKING UP FILES...
%BackupCmd2% "%BackupSource2%" "%BackupTarget2%%bkupfldr%\"
echo+
echo BACKUP COMPLETED!
echo %date% %time%
pause
exit
:noback
echo Please insert your USB key and run this once more
pause
exit
What is happening is this.
On my desktop which has WinXP the dates come out for the
folders like this:
2016-12-16 21-04
That is what I want, but when the .bat is run on Win 8.1 or Win 10.
The folders come out like this:
_ay_17_20_55 (this is supposed to be May 2017 20:55)
Any suggestions how I can fix the .bat when run on Win 8.1/10
so the dates look like:
2016-12-16 21-04 ?