first part – %date:~0,2%
second part – %date:~3,2%
third part – %date:~6,4%
This is similar if you use substring function:
first part – substr(date, 0, 2)
second part – substr(date, 3, 2)
third part – substr(date, 6, 4)
The file (backup_stuff.bat) will look like this:
In order to backup more directories or to backup same directories every time the file is executed ‘/a‘ must be used. ‘/a‘ is used to append a directory to an existing backup.
For every directory in the backup process, the backup window will open.
источник
second part – %date:~3,2%
third part – %date:~6,4%
This is similar if you use substring function:
first part – substr(date, 0, 2)
second part – substr(date, 3, 2)
third part – substr(date, 6, 4)
The file (backup_stuff.bat) will look like this:
@set today_date=%date:~6,4%_%date:~3,2%_%date:~0,2%
ntbackup backup c:\Games /f "\\server\d$\bkp\backup_%today_date%.bkf"
ntbackup backup C:\music /f "\\server\d$\bkp\backup_%today_date%.bkf" /a
In order to backup more directories or to backup same directories every time the file is executed ‘/a‘ must be used. ‘/a‘ is used to append a directory to an existing backup.
For every directory in the backup process, the backup window will open.
источник