0


批处理文件安装应用

@echo off

cls

echo %~dp0
color 2
echo 请选择要安装的应用:1、postman 2、Xmind 3、firefox 4、pycharm Q、退出

:cho
set /p choice=请选择:
if "%choice%"=="1" goto install_postman
if "%choice%"=="2" goto install_Xmind
if "%choice%"=="3" goto install_firefox
if "%choice%"=="4" goto install_pycharm
if "%choice%"=="Q" goto end
echo 选择无效,请重新输入
goto cho

: install_postman
echo install postman
start /d "%~dp0application" Postman-win64-7.32.0-Setup.exe /wait /S
ping -n 15 127.0.0.1>nul 2>nul
echo install postman...OK
goto cho

: install_Xmind
echo install Xmind
start /d "%~dp0application" XMind-2020-for-Windows-64bit-10.2.1-202007272308.exe /S
ping -n 15 127.0.0.1>nul 2>nul
echo install Xmind...OK
goto cho

: install_firefox
echo install firefox
start /d "%~dp0application" Firefox_Setup_87.0-bzb32.exe /S
ping -n 15 127.0.0.1>nul 2>nul
echo install firefox...OK
goto cho

: install_pycharm
echo install pycharm
start /d "%~dp0application" pycharm-community-2020.3.3.exe /wait /S
ping -n 15 127.0.0.1>nul 2>nul
echo install pycharm...OK
goto cho

:end
pause

应用安装包放在application 这个文件夹,bat文件放在application这个文件夹同级目录就好

传参信息

/d 执行文件的路径
/S 静默安装

标签: cmd

本文转载自: https://blog.csdn.net/weixin_44993143/article/details/122287704
版权归原作者 Jerry Lee~ 所有, 如有侵权,请联系我们删除。

“批处理文件安装应用”的评论:

还没有评论