Board logo

标题: [系统相关] 批处理文件想用一键关掉公司里所有电脑 [打印本页]

作者: dfavvee    时间: 2009-4-11 20:32     标题: 批处理文件想用一键关掉公司里所有电脑

本帖最后由 pcl_test 于 2016-8-10 16:18 编辑

帮我改进一下,感谢。
shutdown -s -f -t 10 -m \\sur01
shutdown -s -f -t 10 -m \\sur02
shutdown -s -f -t 10 -m \\sur03
shutdown -s -f -t 10 -m \\sur04
shutdown -s -f -t 10 -m \\sur05
shutdown -s -f -t 10 -m \\sursm
shutdown -s -f -t 10 -m \\hr01
shutdown -s -f -t 10 -m \\hr02
shutdown -s -f -t 10 -m \\hr03
shutdown -s -f -t 10 -m \\hr04
shutdown -s -f -t 10 -m \\hr05
。。。。。。。。。。。。。。。

我这个我写的批处理,因为不是所有电脑都要关,只关办公的电脑,所以我一个个写上去了
可是问题出现了:打个比方所有电脑都开着,除了sur02电脑在关机状态
当我运行批文件之后,就卡在sur02了,下面的都不执行了。现在就是有没办法如果电脑已经关闭了就跳过不执行这条shutdown。

谢谢,在线等

[ 本帖最后由 dfavvee 于 2009-4-11 20:34 编辑 ]
作者: tireless    时间: 2009-4-11 20:47

  1. @echo off
  2. set list=sur01 sur02 sur03 sur04 sur05 sursm hr01 hr02 hr03 hr04 hr05
  3. for %%a in (%list%) do start /b shutdown -s -f -t 10 -m \\%%a
复制代码

作者: dfavvee    时间: 2009-4-11 20:50

谢谢,好用了!
作者: lxzzr    时间: 2009-4-13 06:41

开始—运行:shutdown  /I,试试




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