set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%" md "d:\mysql_bak\%ymd%" "D:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe" jeecg --default-character-set=gbk -uroot -proot > d:\mysql_bak\%Ymd%\mysql.sql REM ..... More commands can be added here, depending on how many databases you have, where -Q is followed by the database name -p followed by the password echo Winrar loading... "C:\Program Files\WinRAR\WinRAR.exe" a -ep1 -r -o+ -m5 -df "d:\mysql_bak\%Ymd%.rar" "d:\mysql_bak\%Ymd%" echo OK!
Name this bak.bat.