标题: [系统相关] [已解决]下面这个自动判断时间自动关机的bat代码。应该如何精简下?谢谢 [打印本页]
作者: ygqiang 时间: 2014-11-25 18:52 标题: [已解决]下面这个自动判断时间自动关机的bat代码。应该如何精简下?谢谢
本帖最后由 ygqiang 于 2014-11-26 23:59 编辑
[已解决]下面这个自动判断时间自动关机的bat代码。应该如何精简下?谢谢- at 12:15 taskkill /f /im 软件xx.EXE
- at 12:15 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 12:15 shutdown -s -f -t 2
-
- at 12:16 taskkill /f /im 软件xx.EXE
- at 12:16 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 12:16 shutdown -s -f -t 2
-
- at 12:17 taskkill /f /im 软件xx.EXE
- at 12:17 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 12:17 shutdown -s -f -t 2
-
- at 12:18 taskkill /f /im 软件xx.EXE
- at 12:18 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 12:18 shutdown -s -f -t 2
-
- at 12:19 taskkill /f /im 软件xx.EXE
- at 12:19 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 12:19 shutdown -s -f -t 2
-
-
-
-
- at 21:50 taskkill /f /im 软件xx.EXE
- at 21:50 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:50 shutdown -s -f -t 2
-
- at 21:51 taskkill /f /im 软件xx.EXE
- at 21:51 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:51 shutdown -s -f -t 2
-
- at 21:52 taskkill /f /im 软件xx.EXE
- at 21:52 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:52 shutdown -s -f -t 2
-
- at 21:53 taskkill /f /im 软件xx.EXE
- at 21:53 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:53 shutdown -s -f -t 2
-
- at 21:54 taskkill /f /im 软件xx.EXE
- at 21:54 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:54 shutdown -s -f -t 2
复制代码
作者: CrLf 时间: 2014-11-25 19:16
- SCHTASKS /Create /SC MINUTE /TN doc /TR a.bat
复制代码
作者: ygqiang 时间: 2014-11-25 19:22
回复 2# CrLf - @echo off
- if "%1" == "h" goto begin
- mshta vbscript:createobject("wscript.shell").run("%~fs0 h",0)(window.close)&&exit
- :begin
- rem 下边开始写批处代码了
-
- ping 127.0.0.1 -n 30 >nul 2>nul
-
- sc config schedule start= demand
- net start schedule
- ——————————————————————————————————————————————————————
- :first2
-
- at 21:50 taskkill /f /im 软件xx.EXE
- at 21:50 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:50 shutdown -s -f -t 2
-
- at 21:51 taskkill /f /im 软件xx.EXE
- at 21:51 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:51 shutdown -s -f -t 2
-
- at 21:52 taskkill /f /im 软件xx.EXE
- at 21:52 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:52 shutdown -s -f -t 2
-
- at 21:53 taskkill /f /im 软件xx.EXE
- at 21:53 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:53 shutdown -s -f -t 2
-
- at 21:54 taskkill /f /im 软件xx.EXE
- at 21:54 taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- at 21:54 shutdown -s -f -t 2
-
-
- ping 127.0.0.1 -n 20 >nul 2>nul
-
- goto first2
复制代码
多谢。
开机,就循环运行这个bat代码!
为啥有时关机不了呢?屏幕上只有鼠标指针能动,桌面啥的都没有了。
就是想实现:自动判断时间自动关机
作者: CrLf 时间: 2014-11-25 21:20
- SCHTASKS /Create /SC MINUTE /mo 1 /ST 12:15 /ET 21:54 /TN hahaha /TR c:\a.bat
复制代码
c:\a.bat:- taskkill /f /im 软件xx.EXE
- taskkill /f /im AutoRedrCard.exe
- ping 127.0.0.1 -n 2 >nul 2>nul
- shutdown -s -f -t 2
复制代码
作者: ygqiang 时间: 2014-11-27 00:23
已解决。
http://bathome.net/thread-33071-1-1.html
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |