TEST_install.bat

系统运维

@echo off

肥乡网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、响应式网站等网站项目制作,到程序开发,运营维护。创新互联于2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联。

rem Get the current path
set I_PATH=%CD%

rem Generate configuration file
rem echo 系统安装路径:%I_PATH%\\app > %I_PATH%\\confing.txt

rem Generate the jar configuration file
echo prefix: %I_PATH%\\app\\test >> %I_PATH%\\app\\application.yml
echo pythonPath: %I_PATH%\\app\\test\\python\\python >> %I_PATH%\\app\\application.yml

rem Generate backup bat configuration file
echo @echo off > %I_PATH%\\app\\test\\backup.bat
echo for /f %%%%i in (%I_PATH%\\app\\pid.txt) do (set PID=%%%%i) >> %I_PATH%\\app\\test\\backup.bat
echo taskkill /T /F /PID %%PID%% >> %I_PATH%\\app\\test\\backup.bat
echo mkdir %I_PATH%\\app\\test\\databackup\\%%1\\main>> %I_PATH%\\app\\test\\backup.bat
echo xcopy /y /s /r %I_PATH%\\app\\test\\main %I_PATH%\\app\\test\\databackup\\%%1\\main >> %I_PATH%\\app\\test\\backup.bat
echo %I_PATH%\\app\\start.vbs >> %I_PATH%\\app\\test\\backup.bat
echo exit >> %I_PATH%\\app\\test\\backup.bat

rem Generate recovery bat configuration file
echo @echo off > %I_PATH%\\app\\test\\recovery.bat
echo for /f %%%%i in (%I_PATH%\\app\\pid.txt) do (set PID=%%%%i) >> %I_PATH%\\app\\test\\recovery.bat
echo taskkill /T /F /PID %%PID%% >> %I_PATH%\\app\\test\\recovery.bat
echo rmdir /q /s %I_PATH%\\app\\test\\main >> %I_PATH%\\app\\test\\recovery.bat
echo mkdir %I_PATH%\\app\\test\\main >> %I_PATH%\\app\\test\\recovery.bat
echo xcopy /y /s /r %I_PATH%\\app\\test\\temp\\main %I_PATH%\\app\\test\\main >> %I_PATH%\\app\\test\\recovery.bat
echo rmdir /q /s %I_PATH%\\app\\test\\temp >> %I_PATH%\\app\\test\\recovery.bat
echo %I_PATH%\\app\\start.vbs >> %I_PATH%\\app\\test\\recovery.bat
echo exit >> %I_PATH%\\app\\test\\recovery.bat

rem Generate TEST start bat configuration file
echo @echo off >%I_PATH%\\app\\TEST_start.bat
echo cd %I_PATH%\\app >>%I_PATH%\\app\\TEST_start.bat
echo set http_str=no >>%I_PATH%\\app\\TEST_start.bat
echo java-1.8.0_172\\bin\\curl -s http://127.0.0.1:8080/static/index.html ^> curl.log >>%I_PATH%\\app\\TEST_start.bat
echo findstr "html" curl.log ^>nul 2^>^&1 ^&^& set http_str=html >>%I_PATH%\\app\\TEST_start.bat
echo if %%http_str%%==html goto RUN >>%I_PATH%\\app\\TEST_start.bat
echo del curl.log >>%I_PATH%\\app\\TEST_start.bat
echo title mycmd >>%I_PATH%\\app\\TEST_start.bat
echo for /f "tokens=2 delims=," %%%%a in (\'tasklist /v /fo csv ^^^| findstr /i "mycmd"\') do (set "mypid=%%%%~a") >>%I_PATH%\\app\\TEST_start.bat
echo echo %%mypid%% ^> pid.txt >>%I_PATH%\\app\\TEST_start.bat
echo msg %%username%% /TIME:5 "您好,软件正在启动,请稍等..." >>%I_PATH%\\app\\TEST_start.bat
echo %I_PATH%\\app\\java-1.8.0_172\\bin\\java -jar %I_PATH%\\app\\celloud-test.jar >>%I_PATH%\\app\\TEST_start.bat
echo :RUN >>%I_PATH%\\app\\TEST_start.bat
echo del curl.log >>%I_PATH%\\app\\TEST_start.bat
echo msg %%username%% /TIME:5 "您好,软件已经启动,不需要重复开启,谢谢合作!" >>%I_PATH%\\app\\TEST_start.bat

echo @echo off >%I_PATH%\\app\\start.bat
echo cd %I_PATH%\\app >>%I_PATH%\\app\\start.bat
echo title mycmd >>%I_PATH%\\app\\start.bat
echo for /f "tokens=2 delims=," %%%%a in (\'tasklist /v /fo csv ^^^| findstr /i "mycmd"\') do (set "mypid=%%%%~a") >>%I_PATH%\\app\\start.bat
echo echo %%mypid%% ^> pid.txt >>%I_PATH%\\app\\start.bat
echo %I_PATH%\\app\\java-1.8.0_172\\bin\\java -jar %I_PATH%\\app\\celloud-test.jar >>%I_PATH%\\app\\start.bat

rem Generate TEST start vbs configuration file
echo Set ws = CreateObject("Wscript.Shell") >"%USERPROFILE%\\Desktop\\TEST_start.vbs"
echo ws.currentdirectory = "%I_PATH%\\app" >>"%USERPROFILE%\\Desktop\\TEST_start.vbs"
echo ws.run "cmd /c %I_PATH%\\app\\TEST_start.bat",vbhide >>"%USERPROFILE%\\Desktop\\TEST_start.vbs"

echo Set ws = CreateObject("Wscript.Shell") >%I_PATH%\\app\\TEST_start.vbs
echo ws.currentdirectory = "%I_PATH%\\app" >>%I_PATH%\\app\\TEST_start.vbs
echo ws.run "cmd /c %I_PATH%\\app\\TEST_start.bat",vbhide >>%I_PATH%\\app\\TEST_start.vbs

echo Set ws = CreateObject("Wscript.Shell") >%I_PATH%\\app\\start.vbs
echo ws.currentdirectory = "%I_PATH%\\app" >>%I_PATH%\\app\\start.vbs
echo ws.run "cmd /c %I_PATH%\\app\\start.bat",vbhide >>%I_PATH%\\app\\start.vbs

rem Generate desktop shortcuts
set lnkdir="%USERPROFILE%\\Desktop"
echo [InternetShortcut] >%lnkdir%\\TEST_app.url
echo URL="http://127.0.0.1:8080/static/index.html" >>%lnkdir%\\TEST_app.url

rem delete install.bat
del %I_PATH%\\install.bat


标题名称:TEST_install.bat
链接地址:http://bzwzjz.com/article/chchpe.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 网站建设开发 重庆网站制作 外贸网站建设 成都企业网站建设公司 梓潼网站设计 成都网站设计 成都网站制作 手机网站制作 成都网站设计 成都h5网站建设 成都网站设计 网站制作 高端网站设计 专业网站建设 网站建设方案 手机网站制作 网站建设 高端网站设计推广 成都定制网站建设 网站制作公司 成都网站设计公司 定制网站设计