|
515808051
新手上路

积分 16
发帖 7
注册 2006-12-2
状态 离线
|
『楼 主』:
[求助]智能批处理关机 是高手的进来
使用 LLM 解释/回答一下
可以说是对 这方面根本不懂
从网上找了 这个 断网自动关机 批处理
@echo off
:开始
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto end
goto 开始
:end
shutdown -s -t 600
exit
我想问(求助)的是能不能 更智能化点
比如 ping XXX.XXX.XXX.XXX 通就不执行下一步命令 就是关机命令
如果不通 肯定要关机 问题就是这里 我想延迟30分钟关机后吧
shutdown -s -t 1800
在30分钟内 自动检测PING XXX.XXX.XXX.XXX 通的话
在取消关机命令 shutdown -a 然后在重新 检测IP
如果可以的话 能 多次检测不同的IP 更好
自己怎么改(乱搞)都不行
我看很难哦 可能都没这样的批处理脚本吧
大概意思是这样了 如果有别的方法也可以
如果没法 或有什么 第三工具 之类的 东西 方法 请教了
It can be said that I don't understand this aspect at all. I found this batch script for automatically shutting down when the network is disconnected from the Internet.
@echo off
:start
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto end
goto start
:end
shutdown -s -t 600
exit
What I want to ask (for help) is whether it can be made more intelligent. For example, if the ping to XXX.XXX.XXX.XXX is successful, the next command, which is the shutdown command, will not be executed. If it is not successful, it must definitely shut down. The problem is here. I want to delay the shutdown for 30 minutes, that is, shutdown -s -t 1800. Within 30 minutes, if the ping to XXX.XXX.XXX.XXX is successful, cancel the shutdown command shutdown -a and then re-detect the IP. If it is possible, it would be better to detect multiple different IPs. I can't change it well (fooling around). I think it's difficult. Maybe there is no such batch script. That's probably the general meaning. If there are other methods, it's also okay. If it's not possible or there are some third tools or other methods, please teach me.
|
|
2006-12-2 16:41 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
ping www.cn-dos.net -n 1 >nul 2>nul || (shutdown -s -t 1800
:KO
ping www.baidu.com -n -1 >nul 2>nul && shutdown -a ||goto KO)
goto :eof
代码没有测试,不行再跟帖讨论。
p.s:原帖中的www.cn-dos.com已经被改成www.cn-dos.net了。
Last edited by lxmxn on 2006-12-3 at 07:03 AM ]
@echo off
ping www.cn-dos.net -n 1 >nul 2>nul || (shutdown -s -t 1800
:KO
ping www.baidu.com -n -1 >nul 2>nul && shutdown -a ||goto KO)
goto :eof
The code hasn't been tested. If it doesn't work, follow up with a discussion.
P.S.: The www.cn-dos.com in the original post has been changed to www.cn-dos.net.
Last edited by lxmxn on 2006-12-3 at 07:03 AM ]
|
|
2006-12-2 17:58 |
|
|
515808051
新手上路

积分 16
发帖 7
注册 2006-12-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
多谢 来帮个忙 不行也没法了
对这个批处理 我看了 教程 还是觉得 有点 冒星星了
不知道 lxmxn 这位朋友 你写上面的 东西是什么意思
有点看的懂就简单的几个命令 而已 虽然说没用 但是
都会用基本命令了 我连基本命令都没搞懂。。。。
在搜索中才发现这个BBS 跑来看看 能学多少东西
Last edited by 515808051 on 2006-12-2 at 07:53 AM ]
Thanks, come to help, no way if it doesn't work.
I looked at this batch processing, read the tutorial, and still feel a bit confused.
I don't know what friend lxmxn wrote above means.
I can understand just a few simple commands, although it's not useful, but
I already know basic commands, but I don't even understand basic commands...
I found this BBS in the search and came to take a look to see how much I can learn.
Last edited by 515808051 on 2006-12-2 at 07:53 AM ]
|

借用 lxmxn 头像
莫见怪 |
|
2006-12-2 20:44 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-12-3 01:27 |
|
|
weapfe
初级用户
 
积分 144
发帖 66
注册 2006-11-30
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
CODE:
--------------------------------------------------------------------------------
@echo off
ping www.cn-dos.com -n 1 >nul 2>nul || (shutdown -s -t 1800
:KO
ping www.baidu.com -n -1 >nul 2>nul && shutdown -a ||goto KO)
goto :eof
请问:句子中的" :eof "是什么东东?
:eof course, the translation is:
CODE:
--------------------------------------------------------------------------------
@echo off
ping www.cn-dos.com -n 1 >nul 2>nul || (shutdown -s -t 1800
:KO
ping www.baidu.com -n -1 >nul 2>nul && shutdown -a ||goto KO)
goto :eof
What is ":eof" in the sentence?
|
|
2006-12-3 01:56 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
我不是高手~近来错了
I'm not a pro~ I made a mistake recently
|
|
2006-12-3 02:06 |
|
|
515808051
新手上路

积分 16
发帖 7
注册 2006-12-2
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
还是没人 有法子吗 我现在只能 这样
@echo off
:开始
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto and
goto 开始
:and
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto bnd
goto 开始
:bnd
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto cnd
goto 开始
:cnd
重复几个IP地址而已 没法了
shutdown -s -t 600
exit
Still no one. Is there any way? I can only do this now
@echo off
:start
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto and
goto start
:and
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto bnd
goto start
:bnd
ping XXX.XXX.XXX.XXX
if errorlevel 1 goto cnd
goto start
:cnd
Just repeating several IP addresses. No way.
shutdown -s -t 600
exit
|

借用 lxmxn 头像
莫见怪 |
|
2006-12-3 02:24 |
|
|
lbccyxs
初级用户
 
积分 54
发帖 27
注册 2006-12-2
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
最起码要加个延时的语句,不然网络资源和本机资源消耗太大,就算可以,都没有用!!!!
At least, you need to add a delay statement. Otherwise, the network resources and local resources will be consumed too much. Even if it is possible, it is useless!!!
|
|
2006-12-3 02:30 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
|
2006-12-3 03:20 |
|
|
515808051
新手上路

积分 16
发帖 7
注册 2006-12-2
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
我也在网上找过 也有人问 是否可以延迟
但是没人回答这个问题啊 要是会的话 就不求助了
有没有用 那是看这个人了
I also looked it up online, and some people asked whether it can be delayed, but no one answered this question. If someone knew how, they wouldn't be asking for help. Whether it works or not depends on the person.
|

借用 lxmxn 头像
莫见怪 |
|
2006-12-3 04:17 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
|
2006-12-3 04:36 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
真不知道你们两个人怎么都是这个图片?难道是巧了?
I really don't know why both of you have this picture? Is it just a coincidence?
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-12-3 04:51 |
|
|
515808051
新手上路

积分 16
发帖 7
注册 2006-12-2
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
Originally posted by tao0610 at 2006-12-2 03:36 PM:
可以多用用论坛搜索!
点我点我点我
谢了 但是怎么用啊。。。。开始就说的很清楚了
一 个 字 。。。。 不想说
图片不是巧 注意看我 签名
Originally posted by tao0610 at 2006-12-2 03:36 PM:
Use the forum search more!
Click me Click me Click me
Thanks, but how to use it... It was made clear at the beginning. Just one word... Don't want to say
The picture is not clever. Pay attention to my signature
|

借用 lxmxn 头像
莫见怪 |
|
2006-12-3 05:04 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
楼主的:sleep 10,单位秒
5 楼:sleep 10000,单位毫秒
The building owner's: sleep 10, unit seconds
5th floor: sleep 10000, unit milliseconds
|
|
2006-12-3 05:54 |
|
|
weapfe
初级用户
 
积分 144
发帖 66
注册 2006-11-30
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
楼主的好像有点~~~
为什么我一使用"sleep"命令(前提是把它先copy到目录system32下)窗口就变小了,但用F5的没有问题~~
疑问中~~
The building owner's seems a bit~~~
Why does the window become smaller as soon as I use the "sleep" command (provided that I first copy it to the system32 directory), but it's okay with F5~~
In doubt~~
|
|
2006-12-3 06:07 |
|