windows bat脚本知识汇总

//@echo off后面不显示命令
@echo off
 
//cd/d   D://aa/bb可直接进入d盘
 
echo 请输入分组名:
 
//接收用户输入
set /p group_name=
 
//引用变量
echo 您输入的是:%group_name%
 
pause

启动多个程序

@echo off
start /b /d "D:\development-software\redis\redis-3.2.100" server-start.bat
echo ##########start redis server##########
 
 
start /b /d "D:\development-software\zookeeper\zookeeper-3.4.10\bin"  zkServer.cmd
echo ##########start zookeeper server##########
 
start /b /d "D:\development-software\nginx\nginx-1.12.2"  nginx.exe
echo ##########start nginx##########

循环执行

@echo off
:start
127.1是回环地址127.0.0.1,>null表示不显示ping命令的结果,-n  后为秒数,-w后为次数
ping -n 60 127.1>NUL

echo nihao
goto start
发布了89 篇原创文章 · 获赞 67 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/xl_1803/article/details/99638045
今日推荐