windows bat无限循环的实现
来源:互联网 发布:安卓数据恢复软件 编辑:程序博客网 时间:2024/05/20 11:36
一个简单易行的方式:
:loop goto loop
参考网上文档:
Using the goto command within a batch allows a user to loop or restart a batch file after it has been completed. Below are some examples of how this command can be used. This page was created with the easiest, but not necessarily recommended solution first, to the most difficult solution but recommended method last.
@echo offcls:startecho This is a loopgoto start
In this first example, the computer will print “This is a loop” over and over until you terminate the file. To cancel this example press: CTRL + C.
@echo offcls:startecho This is a looppausegoto start
Next, adding the pause statement before the goto line will prompt the user to press any key before looping the batch file. Adding pause allows the user to run the batch when they’re ready.
@echo offcls:startecho This is a loopset choice=set /p choice="Do you want to restart? Press 'y' and enter for Yes: "if not '%choice%'=='' set choice=%choice:~0,1%if '%choice%'=='y' goto start
Finally, in this last example and most recommend method, the user would be prompted if they want to rerun the batch file. Pressing “y” would use the goto command and go back to start and rerun the batch file. Pressing any other key would exit the batch file. This example is for Windows 2000, XP, and later users if you’re running earlier Windows 98 or earlier you’d need to use the choice command.
参考文档:http://www.computerhope.com/issues/ch001050.htm
- windows bat无限循环的实现
- Windows BAT FOR循环实现100求和
- Windows的bat脚本中for循环
- windows循环删除文件夹.svn的bat
- 通过while实现程序的无限循环
- 无限循环菜单列表的实现
- 无限循环的轮播图ViewPager实现
- 实现ViewPager无限循环的方式一
- 实现ViewPager无限循环的方式二
- ViewPager实现无限循环的广告位
- 实现gallery无限循环
- 无限循环轮播图实现
- ViewPager实现无限循环
- ViewPager实现无限循环
- 实现无限循环ViewPager
- 无限循环的ScrollView,原理以及实现,自动循环!!!
- windows--bat--%0无限执行当前bat脚本
- 无限循环的ViewPager
- Android N
- 枚举类型
- 深入讲解Android Property机制
- spark-shell 统计hbase数据条目数
- 列表搜索条件美化
- windows bat无限循环的实现
- socket.io 网络聊天室
- web项目如何获取容器
- ffmpeg关于io的输入输出操作
- HP Laserjet1010网络打印机安装 win7 64bit
- Android:视图绘制(五) ------Paint进阶之PathEffect
- Eclipse 配置黑色主题
- 172. Factorial Trailing Zeroes
- java发送http的get、post请求