批处理删除指定目录及子目录下所有.svn目录
2015-01-21 11:20
288 查看
批处理删除指定目录及子目录下所有.svn目录
Java代码
@REM 根据用户输入,删除指定目录及子目录下所有.svn目录
@echo off
:inputPath
set DESTINATION_PATH=:
set /p DESTINATION_PATH="Please input the root directory need to clear the svn folders , press enter ! :"
if not exist %DESTINATION_PATH% (
@echo [Warn] The input directory does not exist ! Input again please!
goto inputPath
)
echo Root directory is : %DESTINATION_PATH%
:inputChoice
@REM 获取输入,根据输入进行处理
set choice=:
set /p choice="Clear the svn folders under the %DESTINATION_PATH% ?[Y/N/Q] :"
@REM 把引号“"”替换成空字符
set "choice=%choice:"=%"
if "%choice%"=="y" goto clean
if "%choice%"=="Y" goto clean
if "%choice%"=="n" goto noClean
if "%choice%"=="N" goto noClean
if "%choice%"=="q" goto end
if "%choice%"=="Q" goto end
goto inputChoice
:clean
@REM 主处理过程,执行清理工作
@echo on
@REM /d:只搜索目录 批处理中使用%%i标识变量 dos窗口使用%i标识
@for /d /r %DESTINATION_PATH% %%i in (.svn) do @if exist %%i ( rd /s /q %%i & echo Delete folder : %%i)
@echo off
echo "Clear the svn folders under the %DESTINATION_PATH% is ok !"
goto end
:noClean
@REM 分支过程,取消清理工作
echo "Operation cancel !"
goto end
:end
@REM 退出程序
pause
本文来自:Linux学习网
Java代码
@REM 根据用户输入,删除指定目录及子目录下所有.svn目录
@echo off
:inputPath
set DESTINATION_PATH=:
set /p DESTINATION_PATH="Please input the root directory need to clear the svn folders , press enter ! :"
if not exist %DESTINATION_PATH% (
@echo [Warn] The input directory does not exist ! Input again please!
goto inputPath
)
echo Root directory is : %DESTINATION_PATH%
:inputChoice
@REM 获取输入,根据输入进行处理
set choice=:
set /p choice="Clear the svn folders under the %DESTINATION_PATH% ?[Y/N/Q] :"
@REM 把引号“"”替换成空字符
set "choice=%choice:"=%"
if "%choice%"=="y" goto clean
if "%choice%"=="Y" goto clean
if "%choice%"=="n" goto noClean
if "%choice%"=="N" goto noClean
if "%choice%"=="q" goto end
if "%choice%"=="Q" goto end
goto inputChoice
:clean
@REM 主处理过程,执行清理工作
@echo on
@REM /d:只搜索目录 批处理中使用%%i标识变量 dos窗口使用%i标识
@for /d /r %DESTINATION_PATH% %%i in (.svn) do @if exist %%i ( rd /s /q %%i & echo Delete folder : %%i)
@echo off
echo "Clear the svn folders under the %DESTINATION_PATH% is ok !"
goto end
:noClean
@REM 分支过程,取消清理工作
echo "Operation cancel !"
goto end
:end
@REM 退出程序
pause
本文来自:Linux学习网
相关文章推荐
- 批处理删除指定目录及子目录下所有.svn目录
- 批处理删除指定目录及子目录下所有.svn目录
- Python_删除/创建指定目录及其下所有子目录的文件,该文件记录当前文件夹的内容
- NO.48 删除某目录下所有指定名称的目录(比如批量删除.svn目录)
- Java版本的删除指定目录及子目录下名叫“xxx.txt”的所有文件
- 删除指定目录下除开指定文件外所有文件的批处理命令
- 删除指定目录下大小为0的所有文件(包含子目录)
- [批处理]把指定文件复制到指定目录下的所有子目录下(包括子目录的下级目录)
- [工具]删除目录及子目录下的所有.svn目录
- 删除指定天数文件,再删除所有的空目录批处理文件
- 删除指定目录下的所有.svn文件
- 一个使用多线程删除指定目录及子目录下所有指定文件的Java程序(源码)
- 删除所有svn文件(一个目录和其各级子目录下的) 两种方法
- Python_删除/创建指定目录及其下所有子目录的文件,该文件记录当前文件夹的内容
- 用批处理从所有子目录中删除指定类型的文件
- 批量处理 删除指定目录与子目录下的.svn文件夹
- 删除指定目录下除开指定文件外所有文件的批处理命令
- 批处理-删除目录和所有子目录里的指定后缀文件
- 使用批处理命令移动子目录下的所有文件到当前目录下,并删除子目录
- 删除一个目录及其子目录下的所有.svn文件