批处理删除SVN标记

news/2024/6/3 6:20:25 标签: svn, 工作, dos, input, c
cle class="baidu_pl">
cle_content" class="article_content clearfix">
content_views" class="htmledit_views"> 简单的说࿰c;批处理就是一些class="tags" href="/tags/DOS.html" title=dos>dos命令的组合。今天小试牛刀࿰c;写了第一个批处理程序࿰c;顺便也了解了一下常用的class="tags" href="/tags/DOS.html" title=dos>dos命令。以前总觉得class="tags" href="/tags/DOS.html" title=dos>dos的东西有些过时࿰c;一直没有好好的学过࿰c;初次尝试了一下其便利性࿰c;也算多了一点知识。程序代码如下:
class="postBody">
cnblogs_post_body">
cellspacing="0" cellpadding="0" style="border-collapse:collapse; background:#cccccc">
color:#ece9d8; padding-bottom:0cm; background-color:transparent; border-top-color:#ece9d8; padding-left:5.4pt; width:389.05pt; padding-right:5.4pt; border-right-color:#ece9d8; border-left-color:#ece9d8; padding-top:0cm">

color:#0000ff">@echo off

color:#0000ff">:start
::启动过程࿰c;切换目录
set pwd=%cd%
cd %1
echo class="tags" href="/tags/GongZuo.html" title=工作>工作目录是:& chdir

color:#0000ff">:class="tags" href="/tags/INPUT.html" title=input>input
::获取输入࿰c;根据输入进行处理
set source=:
set /p source=确定要清楚当前目录下的class="tags" href="/tags/SVN.html" title=svn>svn信息吗?[Y/N/Q]
set "source=%source:"=%"

color:#0000ff">if "%source%"=="y" goto clean
if "%source%"=="Y" goto clean
if "%source%"=="n" goto noclean
if "%source%"=="N" goto noclean
if "%source%"=="q" goto end
if "%source%"=="Q" goto end
goto class="tags" href="/tags/INPUT.html" title=input>input

color:#0000ff">:clean
::主处理过程࿰c;执行清理class="tags" href="/tags/GongZuo.html" title=工作>工作
@echo on
@for /d /r %%c in (.class="tags" href="/tags/SVN.html" title=svn>svn) do @if exist %%c ( rd /s /q %%c & echo     删除目录%%c)
@echo off
echo "当前目录下的class="tags" href="/tags/SVN.html" title=svn>svn信息已清除"
goto end

color:#0000ff">:noclean
::分支过程࿰c;取消清理class="tags" href="/tags/GongZuo.html" title=工作>工作
echo "class="tags" href="/tags/SVN.html" title=svn>svn信息清楚操作已取消"
goto end

color:#0000ff">:end
::退出程序
cd "%pwd%"
pause

ckground:white"> 下面简单介绍一下程序功能。该程序用于删除循环指定目录下名字为.class="tags" href="/tags/SVN.html" title=svn>svn的子目录࿰c;即删除class="tags" href="/tags/SVN.html" title=svn>svn信息。可以拷贝上述代码到wendows下文本文件中࿰c;修改后缀名为.bat即可。使用时࿰c;不带参数则当前目录为class="tags" href="/tags/GongZuo.html" title=工作>工作目录࿰c;带参数则第一个参数为class="tags" href="/tags/GongZuo.html" title=工作>工作目录(没有对参数的校验)。
ckground:white"> 第一段代码打印class="tags" href="/tags/GongZuo.html" title=工作>工作目录;第二、三段代码循环获取和解析参数࿰c;并转向对应的操作;第四段遍历删除子目录;第五段取消删除操作;第六段退出程序。
ckground:white"> 相关命令:
ckground:white"> color:blue">@ 不打印本命令
ckground:white"> color:blue">echo on|off 打开|关闭后面命令的显示
ckground:white"> color:blue">set 设置参数或环境变量
ckground:white"> color:blue">goto 跳转
ckground:white"> color:blue">pause 暂停程序࿰c;界面显示“请按任意键继续……”
ckground:white"> 程序中比较复杂的命令只有一条:
cm 0cm 0pt 21pt"> color:blue">@for /d /r %%c in (.class="tags" href="/tags/SVN.html" title=svn>svn) do @if exist %%c ( rd /s /q %%c & echo     color:blue">删除目录 color:blue">%%c)
ckground:white"> color:blue">for /r 循环遍历当前目录࿰c; color:blue">/d 指定遍历的是目录而不是文件࿰c;目录名为.class="tags" href="/tags/SVN.html" title=svn>svn; color:blue">if exist 先检查目录存不存在࿰c;存在则执行删除( color:blue">rd )操作࿰c;并打印删除信息。
cle>

http://www.niftyadmin.cn/n/615110.html

相关文章

模板引擎总结(Thymeleaf,FreeMarker,Enjoy,Velocity,JSP等)

在java领域,表现层技术主要有以下几种, (1)jsp; (2)freemarker; (3)velocity; (4)thymeleaf; (5)Enjoy; 1.JSP 优点: 1、…

Spring Boot开发Web应用之Thymeleaf篇

前言 Web开发是我们平时开发中至关重要的,这里就来介绍一下Spring Boot对Web开发的支持。 正文 Spring Boot提供了spring-boot-starter-web为Web开发予以支持,spring-boot-starter-web为我们提供了嵌入的Tomcat以及Spring MVC的依赖。 项目结构推荐 一个…

通过【偷取此锁定】或【破除锁定】解锁SVN被锁定的文件的控制权

现在很多项目开发都使用SVN作为馆控工具,SVN馆中的文件既可以以文件夹的方式获取,也可以通过eclipse导入。获取文件后,我们可以对某个文件锁定。 如果某个同事锁定了某个文件,而他却找不到是在哪个地方(如工程或文件夹…

Spring集成Swagger,Java自动生成Api文档

Swagger官网:http://swagger.io GitHub地址:https://github.com/swagger-api 官方注解文档:http://docs.swagger.io/swagger-core/apidocs/index.html Swagger-UI地址:https://github.com/swagger-api/swagger-ui swagger最终效果…

git\xadmin

git 安装 """ 1.下载对应版本:https://git-scm.com/download 2.安装git:在选取安装路径的下一步选取 Use a TrueType font in all console windows 选项-- 安装成功后桌面右键可以看到git菜单 """ 工作流程图 搭建本地git…

this web application instance has been stopped already解决办法

重启tomcat的时候出错 Illegal access: this web application instance has been stopped already. Could not load oracle.net.mesg.Message. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate…

navicat使用 pymysql操作数据库 sql注入及增删改查

下载地址:<https://pan.baidu.com/s/1bpo5mqj> 批量加注释&#xff1a;ctrl&#xff1f;键  批量去注释&#xff1a;ctrlshift&#xff1f;键 导出的sql语句代码mysql/* 数据导入&#xff1a; Navicat Premium Data Transfer Source Server : localhost Source…

Spring Boot默认日志logback配置解析

前言 今天来介绍下Spring Boot如何配置日志logback,我刚学习的时候&#xff0c;是带着下面几个问题来查资料的&#xff0c;你呢 如何引入日志&#xff1f;日志输出格式以及输出方式如何配置&#xff1f;代码中如何使用&#xff1f;正文 Spring Boot在所有内部日志中使用Commons…