cmd /c "C:\Program Files\WinRAR\WinRAR.exe" m -ag -cfg- -ibck -inul -m5 -s -y "D:\BAK\MyDb_" "D:\BAK\MyDb_%date:~0,4%%date:~5,2%%date:~8,2%完全备份.BAK"
If you think the command above is too long, you can use a batch file:
@echo off
set han=D:\BAK\MyDb_%date:~0,4%%date:~5,2%%date:~8,2%
"C:\Program Files\WinRAR\WinRAR.exe" m -afrar -cfg- -ibck -inul -m5 -or -s -y %han% %han%完全备份.BAK
pause&exit
Explanation:
Example of the %date% variable: 2009-06-17 Wednesday
Explanation of WinRAR command switches:
Command M - move files and folders to the archive (that is, delete the original source/target files after compressing)
Switch -AG - generate the archive filename using the current date and time
Switch -AF<type> - specify the archive format
Switch -CFG- - ignore default settings and environment variables
Switch -DR - clear files after archiving. Before deleting the files, overwrite the file data with 0 bytes to prevent the files from being recovered.
Switch -IBCK - run WinRAR in the background
Switch -INUL - disable error messages
Switch -IOFF - shut down PC power
Switch -M<n> - set compression method
Switch -OR - automatically rename extracted files if a file with the same name already exists.
Switch -S - create solid archive
Switch -Y - assume the answer to all prompts is “yes”
Switch -TA<date> - only process files modified after the specified date
Switch -TB<date> - process files modified before the specified date
Switch -TN<time> - process files newer than the specified time
Switch -TO<time> - process files older than the specified time
OP, pay attention to post format and the topic title, so that after I reply it doesn't always get deleted. . .
[ Last edited by Hanyeguxing on 2009-6-17 at 02:39 ]