开发日记:常用BAT批处理
Posted luomingui
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了开发日记:常用BAT批处理相关的知识,希望对你有一定的参考价值。
备份文件:BackupSourceCode.bat
::自动备份当前文件夹 ::by luomg, 21:15 2010-10-13 ::[email protected] @echo off title "DoNetCore bakpath" set "lj=%~p0" set "lj=%lj:\= %" for %%a in (%lj%) do set wjj=%%a echo 当前文件夹是:%wjj% set b=%cd% set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%" set "bakpath=F:\Github2018\backup\%wjj%_%ymd%\" echo 当前路径:%b% echo 备份路径:%bakpath% md %bakpath% xcopy /e /y %b% %bakpath% ping /n 3 127.0.0.1 >nul @echo 数据备份完成,3秒后程序退出。 ::exit @pause
清理项目无用文件:Cleanfiles.bat
@for /r . %%I in (debug) do if exist "%%I" rd/s/q "%%I" @for /r . %%I in (bin) do if exist "%%I" rd/s/q "%%I" @for /r . %%I in (obj) do if exist "%%I" rd/s/q "%%I" @for /r . %%I in (clientbin) do if exist "%%I" rd/s/q "%%I" @for /r . %%I in (TestResults) do if exist "%%I" rd/s/q "%%I" del /s/q/f *.user del /s/q/f *.suo del /s/q/f *.vspscc rd /s/q .vs
以上是关于开发日记:常用BAT批处理的主要内容,如果未能解决你的问题,请参考以下文章