Save the following code as aaa. bat
@ Echo off
Echo.
Echo MySQL database backup
Echo *****************************
Echo.
Echo today is % date %
Echo time is % time %
The echo command for deleting folders is rd/s/q d: \ decode.
Echo command to delete all files in the folder is del/s/q d: \ decode
Echo.
Echo *****************************
Rd/s/q D: \ % Ymd % \
Set "Ymd = % date :~, 4% % date :~ 5, 2% % date :~ 8, 2%"
Md "D: \ % Ymd %"
"D: \ Mysql50 \ bin \ mysqldump"-opt-Q-uphpweb3-pphpweb3-default-character-set = utf8 phpweb3> "D: \ % Ymd % \ mySQLteble. SQL"
Echo.
Echo MySQL database backup is complete. Please check...
Echo.
Echo.
Pause
The rd/s/q D: \ % Ymd % \ statement is the same as the backup directory. It is automatically cleared and all files in the directory are saved. Then md re-creates the directory. In this way, the backup is cleared automatically.