cmd 分支选择示例

@echo off

set serverDir=\\10.80.3.252\测试专用(勿动)\packtool_v4.0\config
REM set serverDir=C:\tmp2\config
set localDir=D:\sci\ADT\单机工具


echo -----------------------------------------------
echo 单机工具配置文件更新

:Step1
echo -----------------------------------------------
echo 请选择要操作的文件
set /p choice2=1、ApkUtility  2、BillingGrab  3、KeyWord_Search  4、PackingTool  5、退出 :


:Step1_Next
if %choice2%==1 goto ApkUtility
if %choice2%==2 goto BillingGrab
if %choice2%==3 goto ApkUtility
if %choice2%==4 goto BillingGrab
if %choice2%==5 goto end


REM 设置文件路径参数
:ApkUtility 
set FileName=ApkUtility_config.txt
set sourceFile=%serverDir%\%FileName%
set targetFile1=%localDir%\ApkUtility\src\%FileName%
set targetFile2=%localDir%\ApkUtility\ApkUtility_tools\%FileName%
goto Step2

:BillingGrab
set FileName=BillingGrab_config.txt
set sourceFile=%serverDir%\%FileName%
set targetFile1=%localDir%\BillingGrab\src\%FileName%
set targetFile2=%localDir%\BillingGrab\BillingGrab_tools\%FileName%
goto Step2

:KeyWord_Search
set FileName=KWSearch_config.txt
set sourceFile=%serverDir%\%FileName%
set targetFile1=%localDir%\KeyWord_Search\src\%FileName%
set targetFile2=%localDir%\KeyWord_Search\KWSearch_tools\%FileName%
goto Step2

:PackingTool
set FileName=PackingTool_config.txt
set sourceFile=%serverDir%\%FileName%
set targetFile1=%localDir%\PackingTool\src\%FileName%
set targetFile2=%localDir%\PackingTool\tools\%FileName%
goto Step2


:Step2
if i==2 goto Step1_Next
echo -----------------------------------------------
echo 请选择要执行的操作
set /p choice1=1、下载配置文件到本地 2、上传本地配置文件 :
echo -----------------------------------------------

:Step2_Next
if %choice1%==1 goto download
if %choice1%==2 goto upload

:download
echo 下载配置文件到本地...
if exist %sourceFile% echo 复制文件 %sourceFile% 到 %targetFile1%
if exist %sourceFile% copy /Y %sourceFile% %targetFile1%
if exist %sourceFile% echo 复制文件 %sourceFile% 到 %targetFile2%
if exist %sourceFile% copy /Y %sourceFile% %targetFile2%
goto Step1

:upload
echo 上传本地配置文件...
if exist %targetFile1% echo 复制文件 %targetFile1% 到 %sourceFile%
if exist %targetFile1% copy /Y %targetFile1% %sourceFile%
if exist %targetFile1% echo 复制文件 %targetFile1% 到 %targetFile2%
if exist %targetFile1% copy /Y %targetFile1% %targetFile2%
goto Step1


REM 退出
:end
exit


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值