源代码备份批处理

    今天由于电脑总是掉电,以防万一,写这个批处理将平时写的源代码自动备份压缩存放起来,以防止丢失。将以下保存到系统目录下的一个批处理文件中,在开始运行中输入批处理名称即可。运行完毕,将在桌面生成打包好的源代码压缩包。再将其发送到网络优盘即可。

 IF NOT EXIST F:/CodeBak MD F:/CodeBak IF NOT EXIST F:/CodeBak/TsReManager MD F:/CodeBak/TsReManager IF NOT EXIST F:/CodeBak/InterfaceDebug MD F:/CodeBak/InterfaceDebug IF NOT EXIST F:/CodeBak/FilePackageManager MD F:/CodeBak/FilePackageManager IF NOT EXIST F:/CodeBak/FileOper MD F:/CodeBak/FileOper xcopy /s F:/larkProject/TsReManager F:/CodeBak/TsReManager xcopy /s F:/larkProject/InterfaceDebug F:/CodeBak/InterfaceDebug xcopy /s F:/larkProject/FilePackageManager F:/CodeBak/FilePackageManager xcopy /s D:/Test/FileOper F:/CodeBak/FileOper del /s F:/CodeBak/*.ncb del /s F:/CodeBak/*.pkg del /s F:/CodeBak/*.ilk del /s F:/CodeBak/*.pdb del /s F:/CodeBak/*.manifest del /s F:/CodeBak/*.exe del /s F:/CodeBak/*.user del /s F:/CodeBak/*.htm del /s F:/CodeBak/*.res del /s F:/CodeBak/*.dep del /s F:/CodeBak/*.obj del /s F:/CodeBak/*.idb pause ECHO 下面备份F:/CodeBak目录中的文件并还原 IF NOT EXIST F:/tCodeBak MD F:/tCodeBak ECHO 备份指定文件夹下包含子目录的所有文件并带盘符的完整路径 "C:/Program Files/WinRAR/RAR.exe" A F:/tCodeBak/codebak.rar -AD -EP3 F:/CodeBak "C:/Program Files/WinRAR/RAR.exe" X -Y -EP3 F:/tCodeBak/codebak.rar rem ECHO 下面把当前目录中所有的压缩包文件解压到D盘DATA下 rem IF NOT EXIST D:/Code MD D:/Code rem rar x -ad F:/tCodeBak/codebak.rar D:/Code/ copy F:/tCodeBak/codebak.rar "C:/Documents and Settings/Administrator/桌面" rd /s /q F:/tCodeBak rd /s /q F:/CodeBak

你可能感兴趣的:(c,网络)