China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 11:09
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Problems with the ping command? View 2,757 Replies 17
Original Poster Posted 2007-06-27 16:35 ·  中国 上海 电信
新手上路
Credits 6
Posts 2
Joined 2007-06-27 16:11
19-year member
UID 92501
Gender Male
Status Offline
Ping www.163.com, I want to know the result of whether it is pinged successfully. How to know this structure in batch commands?
Floor 2 Posted 2007-06-27 16:56 ·  中国 上海 电信
新手上路
Credits 6
Posts 2
Joined 2007-06-27 16:11
19-year member
UID 92501
Gender Male
Status Offline
Originally posted by shellfj at 2007-6-27 04:35 PM:
Ping www.163.com, I want to know the result of whether it is pinged through. How to know this structure in the batch command?


Just registered, first post, hope everyone supports.
Floor 3 Posted 2007-06-28 05:24 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
```
ping www.163.com >nul 2>nul && echo OK || echo NO
```
Floor 4 Posted 2007-06-28 17:28 ·  中国 广东 东莞 电信
初级用户
DOS之星
Credits 55
Posts 26
Joined 2007-06-25 10:15
19-year member
UID 92283
Gender Male
Status Offline
I can't understand ah what are you guys talking about
Floor 5 Posted 2007-06-28 18:05 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Originally posted by woainiphj at 2007-6-28 17:28:
I can't understand. What are you talking about

Discussing whether the ping command was executed successfully.
Floor 6 Posted 2007-06-28 18:49 ·  中国 上海 电信
中级用户
★★
Credits 231
Posts 112
Joined 2007-06-19 20:44
19-year member
UID 91827
Gender Male
Status Offline
?

In the past, I seemed to always use errorlevel to judge~
Floor 7 Posted 2007-07-28 18:59 ·  中国 湖北 武汉 电信
新手上路
Credits 16
Posts 8
Joined 2007-07-28 18:31
19-year member
UID 94206
Gender Male
Status Offline
Floor 8 Posted 2007-07-30 01:46 ·  中国 江苏 南京 电信
初级用户
Credits 76
Posts 39
Joined 2007-03-09 06:54
19-year member
UID 81169
Gender Male
Status Offline
ping www.163.com >nul 2>nul && echo OK || echo NO
Very simple, oh.
Once used, you won't forget.
狐狸喜欢狡猾。。
Floor 9 Posted 2007-07-30 08:33 ·  中国 重庆 联通
新手上路
Credits 10
Posts 5
Joined 2007-07-12 22:48
19-year member
UID 93824
Gender Male
Status Offline
Well, simple and easy-to-use command line
Floor 10 Posted 2008-03-18 23:09 ·  中国 上海 浦东新区 电信
初级用户
★★
Credits 177
Posts 85
Joined 2007-12-01 20:40
18-year member
UID 104378
Gender Male
Status Offline
I'm understanding the usage of ping, so I searched.
Found
ping www.163.com >nul 2>nul && echo OK || echo NO

Displaying the results with OK and NO swapped positions is different.........

It should be the same. When ping fails
Reply from 192.168.0.1: Destination net unreachable
It will also display OK........
Floor 11 Posted 2008-03-19 23:47 ·  中国 北京 华为云
初级用户
Credits 71
Posts 34
Joined 2008-03-12 19:53
18-year member
UID 112775
Gender Male
Status Offline
It seems like there is nothing at all
Floor 12 Posted 2008-03-24 23:59 ·  中国 上海 浦东新区 电信
初级用户
★★
Credits 177
Posts 85
Joined 2007-12-01 20:40
18-year member
UID 104378
Gender Male
Status Offline
Originally posted by lxmxn at 2007-6-28 06:05 PM:

Discuss whether the ping command is executed successfully.



TO lxmxn
Can you help answer the question on floor 10? THS!
Floor 13 Posted 2008-03-26 13:49 ·  中国 上海 电信
初级用户
小菜
Credits 36
Posts 18
Joined 2008-01-13 04:44
18-year member
UID 108453
Gender Male
Status Offline
Got it. Although I still can't understand some of these commands now, keep trying, keep trying.
我是新手 请多多指教
Floor 14 Posted 2008-03-27 02:14 ·  中国 海南 海口 电信
初级用户
Credits 24
Posts 12
Joined 2006-03-17 02:12
20-year member
UID 52232
Status Offline
Can you explain this command? I don't understand it. NUL is the null device.
2>NUL?? I don't understand.
2>nul && echo OK || echo NO I can't understand either. Experts, please explain. Let's learn bit by bit.
Floor 15 Posted 2008-03-27 10:51 ·  中国 广东 深圳 宝安区 电信
新手上路
Credits 4
Posts 2
Joined 2008-03-27 09:26
18-year member
UID 114151
Gender Male
Status Offline
If the ping is successful, what actions can be taken?
Forum Jump: