Board logo

标题: [系统相关] WIN7下有些命令用不了 [打印本页]

作者: luqgj@126.com    时间: 2013-1-24 22:59     标题: WIN7下有些命令用不了

WIN7下有些命令用不了
我是在XP里定的,可拿回家用WIN7的就出现了几个错了
大家如果是WIN7的系统不防帮我看下
谢谢!
  1. @echo off
  2. title spring-clover
  3. color 0a
  4. mode con: cols=80 lines=22
  5. setlocal enabledelayedexpansion
  6. set "t=欢迎使用WIN7无线AP设置程序"
  7. set "a=                  程序制作:聆歌忆往"
  8. for /l %%a in (1 1 8) do echo.
  9. for %%a in ("!t!" "!a!" ) do call :string %%a 10 24
  10. for /l %%a in (1 1 6) do echo.
  11. echo 启动中,请稍候......
  12. set/p=  =============================================================================<nul
  13. for /l %%d in (1 1 78) do set /p=<nul
  14. for /l %%d in (1 1 78) do (set /p=^><nul&call :sleep 10)
  15. echo.
  16. :menu
  17. cls
  18. for /l %%a in (1 1 9) do echo.
  19. echo              1.设置WIN7 AP  2.启动WIN7 AP  3.禁用WIN7 AP
  20. echo.
  21. echo.
  22. set "c="
  23. set/p c=请选择(1-2-3):
  24. if {!c!}=={1} goto config1
  25. if {!c!}=={2} goto config2
  26. if {!c!}=={3} goto config3
  27. goto error
  28. :string
  29. set "string=%1"
  30. set t=%2
  31. set p=%3
  32. if defined p (for /l %%b in (1 1 %3) do set/p=^ <nul)
  33. :str
  34. set word=!string:~0,1!
  35. set string=!string:~1!
  36. set /p=!word!<nul&call :sleep !t!
  37. if defined string goto str
  38. echo.
  39. echo.
  40. echo.
  41. goto :eof
  42. :sleep
  43. set Time1=%time%
  44. set/a minute1=1%Time1:~3,2%-100
  45. set/a second1=1%Time1:~6,2%%Time1:~-2%0-100000
  46. :Loop
  47. set Time2=%time%
  48. set/a minute2=1%Time2:~3,2%-100
  49. set/a second2=1%Time2:~6,2%%Time2:~-2%0-100000
  50. set/a difMs=((%minute2%-%minute1%+60)%%60)*60000+%second2%-%second1%
  51. if %difMs% lss %1 goto Loop
  52. goto :eof
  53. :config1
  54. set/p x=请输入AP名称:
  55. set/p y=请输入AP密码:
  56. echo 你输入AP名称是!x!,密码是!y!.按任意键程序将进行配置WIN7 AP
  57. pause>nul
  58. netsh wlan set hostednetwork ssid=!x!
  59. netsh wlan set hostednetwork key=!y!
  60. goto menu
  61. :config2
  62. netsh wlan set hostednetwork mode=allow
  63. netsh wlan start hostednetwork
  64. goto menu
  65. :config3
  66. netsh wlan set hostednetwork mode=disallow
  67. netsh wlan stop hostednetwork
  68. goto menu
  69. :error
  70. for /l %%a in (1 1 9) do echo.
  71. echo 你的输入不正确,请重试......
  72. call :sleep 1000
  73. goto menu
复制代码

作者: BAT-VBS    时间: 2013-1-24 23:31

报错信息贴出来
作者: luqgj@126.com    时间: 2013-1-26 10:50

算了,我还是换一个方法问吧
在WIN 7下怎么写WIN XP的进度条啊




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2