【Windows学习】bat脚本

【Windows学习】bat脚本
  1 @echo off
  2 title Run Edr Usecases
  3 color 0a
  4 
  5 ::pip install -i http://mirrors.sangfor.org/pypi/web/simple --trusted-host mirrors.sangfor.org cryptography==2.2.2 
  6 
  7 :input_workspace
  8 echo "Run Usecases On Windows"
  9 set WORKSPACE=%~dp0\..\..
 10 echo "============Current workspace dir is================"
 11 dir %WORKSPACE%
 12 
 13 :down_code
 14 REM 是否下载最新代码并且安装
 15 set /p choice=是否下载最新代码并安装库(Y/N):
 16 If "%choice%" equ "Y" goto install_lib
 17 If "%choice%" equ "y" goto install_lib
 18 If "%choice%" equ "N" goto start
 19 If "%choice%" equ "n" goto start
 20 goto down_code
 21 
 22 :install_lib
 23 cd %WORKSPACE%
 24 REM kill process
 25 taskkill /F /IM MEM_PE*
 26 taskkill /F /IM edr_auto*
 27 taskkill /F /IM "Git*"
 28 taskkill /F /IM python*
 29 taskkill /F /IM pytest*
 30 
 31 git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/Swiss-Knife.git"
 32 if exist Swiss-Knife (cd Swiss-Knife
 33 git checkout master
 34 git reset --hard
 35 git pull origin master
 36 rmdir /S /Q virus
 37 cd .\..
 38 dir Swiss-Knife) else (git clone -b master http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/Swiss-Knife.git)
 39 
 40 git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ea.git"
 41 if exist ea (cd ea
 42 git checkout EA_V3.2.9_wdl
 43 git reset --hard
 44 git pull origin EA_V3.2.9_wdl
 45 cd .\..
 46 dir ea) else (git clone -b EA_V3.2.9_wdl http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ea.git)
 47 cd ea
 48 git checkout EA_V3.2.9_wdl
 49 cd ..
 50 
 51 git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/awei.git"
 52 if exist awei (cd awei
 53 git checkout AWEI_V3.2.9_wdl
 54 git reset --hard
 55 git pull origin AWEI_V3.2.9_wdl
 56 cd .\..
 57 dir awei) else (git clone -b AWEI_V3.2.9_wdl http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/awei.git)
 58 cd awei
 59 git checkout AWEI_V3.2.9_wdl
 60 cd ..
 61 
 62 git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ronger.git"
 63 if exist ronger (cd ronger
 64 git checkout RONGER_V3.2.9
 65 git reset --hard
 66 git pull origin RONGER_V3.2.9
 67 cd .\..
 68 dir ronger) else (git clone -b RONGER_V3.2.9 http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ronger.git)
 69 
 70 git config --global remote.origin.url http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/uitester.git
 71 if exist uitester (cd uitester
 72 git checkout master
 73 git reset --hard
 74 git pull origin master
 75 cd .\..
 76 dir uitester) else (git clone -b master http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/uitester.git)
 77 
 78 echo "lib install for awei"
 79 cd awei 
 80 python setup.py install
 81 
 82 echo "lib install for ronger"
 83 cd ..\ronger
 84 python setup.py install
 85 
 86 echo "lib install for ea"
 87 cd ..\ea
 88 python setup.py install
 89 
 90 echo "lib install for uitester"
 91 cd ..\uitester
 92 python setup.py install
 93 
 94 :start
 95 cd %WORKSPACE%\ea
 96 echo             Run usercase 1.0版本
 97 ::echo                time:%time:~0,8%
 98 echo     ┏━━━━━━━━━━━━━━━━━━━━┓
 99 echo     ╀                                        ╀
100 echo    A◎ 1.修改工作目录                         ◎
101 echo    A◎ 2.执行bvt用例                          ◎ 
102 echo    A◎ 3.执行smoke_test用例               ◎ 
103 echo    A◎ 4.执行自定义用例                       ◎
104 echo    A◎ 5.执行bvt+level1用例               ◎
105 echo    A◎ 6.生成bvt测试报告                      ◎ 
106 echo    A◎ 7.生成smoke_test测试报告               ◎
107 echo    A◎ 8.生成自定义用例报告                   ◎
108 echo    A◎ 9.生成并发用例报告                     ◎
109 echo    A◎ 10.生成非并发用例报告                  ◎
110 echo    A◎ 11.自定义报告路径后报告                ◎
111 echo    A◎ c.修改操作                             ◎
112 echo    A◎ q.退出                                 ◎
113 echo     ╁                                        ╁
114 echo     ┗━━━━━━━━━━━━━━━━━━━━┛
115 echo.
116 set /p choice=Please input your operation:
117 If "%choice%" equ "1" goto init
118 If "%choice%" equ "2" goto exec_bvt
119 If "%choice%" equ "3" goto smoke_test
120 If "%choice%" equ "4" goto exec_test_usercases
121 If "%choice%" equ "5" goto exec_bvt_level1
122 If "%choice%" equ "6" goto gen_bvt_report
123 If "%choice%" equ "7" goto gen_smoke_test_report
124 If "%choice%" equ "8" goto gen_custom_report
125 If
View Code
【Windows学习】bat脚本
 1 @echo off
 2 echo 正在清理系统垃圾文件,请稍等......
 3 rd /s /q C:\$Recycle.Bin E:\$RECYCLE.BIN  D:\$RECYCLE.BIN F:\$R
 4 ECYCLE.BIN
 5 del /f /s /q %systemdrive%\*.tmp
 6 del /f /s /q %systemdrive%\*._mp
 7 del /f /s /q %systemdrive%\*.log
 8 del /f /s /q %systemdrive%\*.gid
 9 del /f /s /q %systemdrive%\*.chk
10 del /f /s /q %systemdrive%\*.old
11 del /f /s /q %systemdrive%\recycled\*.*
12 del /f /s /q %windir%\*.bak
13 del /f /s /q %windir%\prefetch\*.*
14 rd /s /q %windir%\temp & md %windir%\temp
15 del /f /q %userprofile%\cookies\*.*
16 del /f /q %userprofile%\recent\*.*
17 del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
18 del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
19 del /f /s /q "%userprofile%\recent\*.*"
20 echo 清理系统垃圾完成,感谢你的使用!
View Code

 

@echo offtitle Run Edr Usecasescolor 0a
::pip install -i http://mirrors.sangfor.org/pypi/web/simple --trusted-host mirrors.sangfor.org cryptography==2.2.2 
:input_workspaceecho "Run Usecases On Windows"set WORKSPACE=%~dp0\..\..echo "============Current workspace dir is================"dir %WORKSPACE%
:down_codeREM 是否下载最新代码并且安装set /p choice=是否下载最新代码并安装库(Y/N):If "%choice%" equ "Y" goto install_libIf "%choice%" equ "y" goto install_libIf "%choice%" equ "N" goto startIf "%choice%" equ "n" goto startgoto down_code
:install_libcd %WORKSPACE%REM kill processtaskkill /F /IM MEM_PE*taskkill /F /IM edr_auto*taskkill /F /IM "Git*"taskkill /F /IM python*taskkill /F /IM pytest*
git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/Swiss-Knife.git"if exist Swiss-Knife (cd Swiss-Knifegit checkout mastergit reset --hardgit pull origin masterrmdir /S /Q viruscd .\..dir Swiss-Knife) else (git clone -b master http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/Swiss-Knife.git)
git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ea.git"if exist ea (cd eagit checkout EA_V3.2.9_wdlgit reset --hardgit pull origin EA_V3.2.9_wdlcd .\..dir ea) else (git clone -b EA_V3.2.9_wdl http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ea.git)cd eagit checkout EA_V3.2.9_wdlcd ..
git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/awei.git"if exist awei (cd aweigit checkout AWEI_V3.2.9_wdlgit reset --hardgit pull origin AWEI_V3.2.9_wdlcd .\..dir awei) else (git clone -b AWEI_V3.2.9_wdl http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/awei.git)cd aweigit checkout AWEI_V3.2.9_wdlcd ..
git config --global remote.origin.url "http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ronger.git"if exist ronger (cd rongergit checkout RONGER_V3.2.9git reset --hardgit pull origin RONGER_V3.2.9cd .\..dir ronger) else (git clone -b RONGER_V3.2.9 http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/ronger.git)
git config --global remote.origin.url http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/uitester.gitif exist uitester (cd uitestergit checkout mastergit reset --hardgit pull origin mastercd .\..dir uitester) else (git clone -b master http://oauth2:pr2w76-ayBmxx9TpPYiV@code.sangfor.org/test/EDRT/uitester.git)
echo "lib install for awei"cd awei python setup.py install
echo "lib install for ronger"cd ..\rongerpython setup.py install
echo "lib install for ea"cd ..\eapython setup.py install
echo "lib install for uitester"cd ..\uitesterpython setup.py install
:startcd %WORKSPACE%\eaecho             Run usercase 1.0版本::echo                time:%time:~0,8%echo     ┏━━━━━━━━━━━━━━━━━━━━┓echo     ╀                                        ╀echo    A◎ 1.修改工作目录                         ◎echo    A◎ 2.执行bvt用例                          ◎ echo    A◎ 3.执行smoke_test用例           ◎ echo    A◎ 4.执行自定义用例                   ◎echo    A◎ 5.执行bvt+level1用例           ◎echo    A◎ 6.生成bvt测试报告                      ◎ echo    A◎ 7.生成smoke_test测试报告               ◎echo    A◎ 8.生成自定义用例报告                   ◎echo    A◎ 9.生成并发用例报告                     ◎echo    A◎ 10.生成非并发用例报告                  ◎echo    A◎ 11.自定义报告路径后报告                ◎echo    A◎ c.修改操作                             ◎echo    A◎ q.退出                                 ◎echo     ╁                                        ╁echo     ┗━━━━━━━━━━━━━━━━━━━━┛echo.set /p choice=Please input your operation:If "%choice%" equ "1" goto initIf "%choice%" equ "2" goto exec_bvtIf "%choice%" equ "3" goto smoke_testIf "%choice%" equ "4" goto exec_test_usercasesIf "%choice%" equ "5" goto exec_bvt_level1If "%choice%" equ "6" goto gen_bvt_reportIf "%choice%" equ "7" goto gen_smoke_test_reportIf "%choice%" equ "8" goto gen_custom_reportIf

【Windows学习】bat脚本

上一篇:photoshop 利用滤镜及素材把人物变成水人


下一篇:redis入门及相关API