源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

批处理的"循环"效果脚本

  • 时间:2021-07-25 08:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:批处理的"循环"效果脚本
第一次运行 执行命令工A 第二次运行 执行命令工B 第三次运行 执行命令工A ................ 原理很简单 用if exist 判断 第一次运行时 不存在指定文件  则运行命令A  并创建指定文件 第二次运行时 指定文件存在  则运行命令B 并删除指定文件 第三次运行 又不存在指定文件 ............ 写了两个实例 让大家可以试一下 1. 显示/隐藏文件的扩展名 (运行并刷新后生效) @echo off if not exist c:windows\wind.txt ( break>c:windows\wind.txt reg add hkcu\software\microsoft\windows\currentversion\explorer\advanced /v hidefileext /t reg_dword /d 0 /f ) else ( reg add hkcu\software\microsoft\windows\currentversion\explorer\advanced /v hidefileext /t reg_dword /d 1 /f del c:windows\wind.txt ) 2. 启用/断开宽带连接 @echo off if not exist c:windows\wind.txt ( break>c:windows\wind.txt rasphone /d 宽带连接 ) else ( rasphone /h 宽带连接 del c:windows\wind.txt )
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部