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-06-20 20:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Who can explain the "%"? View 14,054 Replies 72
Floor 46 Posted 2007-10-07 10:50 ·  中国 河北 廊坊 联通
初级用户
Credits 36
Posts 14
Joined 2007-03-04 03:22
19-year member
UID 80710
Gender Male
Status Offline
That's really great. Thanks...
Floor 47 Posted 2007-10-08 04:28 ·  中国 河北 邢台 电信
中级用户
★★
Credits 242
Posts 134
Joined 2006-12-11 15:14
19-year member
UID 73203
Gender Male
Status Offline
Floor 48 Posted 2007-10-25 22:04 ·  中国 湖南 张家界 电信
初级用户
Credits 30
Posts 11
Joined 2007-06-30 16:52
18-year member
UID 92780
Gender Male
Status Offline
It's really good. It feels like I've become old... I can't understand it anymore... Just digest it slowly...
Floor 49 Posted 2007-12-16 11:15 ·  中国 广东 中山 电信
新手上路
Credits 12
Posts 6
Joined 2007-12-16 10:15
18-year member
UID 105802
Gender Male
From 湖南省
Status Offline
Although I don't quite understand... but I still support it
Floor 50 Posted 2007-12-18 22:28 ·  中国 广东 腾讯云
初级用户
Credits 92
Posts 47
Joined 2007-12-07 13:20
18-year member
UID 104967
Gender Male
Status Offline
Support
Floor 51 Posted 2008-01-08 00:17 ·  中国 福建 电信
初级用户
Credits 46
Posts 24
Joined 2008-01-04 22:09
18-year member
UID 107690
Gender Male
Status Offline
Floor 52 Posted 2008-01-09 05:44 ·  中国 广东 广州 白云区 电信
初级用户
Credits 21
Posts 11
Joined 2007-07-05 11:17
18-year member
UID 93199
Gender Male
Status Offline
The 3rd floor is so great!! Give it a thumbs up!
Floor 53 Posted 2008-01-09 11:24 ·  中国 上海 浦东新区 电信
高级用户
★★★
中國DOS聯盟常任參議员
Credits 686
Posts 318
Joined 2005-11-04 13:00
20-year member
UID 77577
Gender Male
Status Offline
There is no function to bookmark theme posts in the forum. I have to reply first and then read slowly
. 繽紛色彩閃出的美麗是因為它沒有分開每種色彩...>/

我的百度空间: BEYOND超越 为什么用DOS
Floor 54 Posted 2008-02-03 01:22 ·  中国 北京 华为云
银牌会员
★★★
永远的菜鸟
Credits 1,335
Posts 574
Joined 2007-11-27 12:50
18-year member
UID 103929
Gender Male
From 广西
Status Offline
I just want to know the answer to the original poster's question %%%%%%
For example below:
@echo off&mode con cols=20 lines=2
title Timer&color 0D
set /a H=0,M=0,S=0
set /a H=%t%%%86400/3600 2>nul
set /a M=%t%%%86400%%3600/60 2>nul
set /a S=%t%%%86400%%3600%%60 2>nul
ping -n 2 127.0|set/p l= Elapsed time: %H%:%M%:%S%
set /a t+=1
cls
%0
Floor 55 Posted 2008-02-18 15:53 ·  中国 湖南 益阳 电信
新手上路
Credits 15
Posts 9
Joined 2008-02-16 15:36
18-year member
UID 110782
Gender Male
Status Offline
Well said, give a thumbs up. When will I be able to be as handy as the predecessors?
Floor 56 Posted 2008-03-22 21:28 ·  中国 辽宁 联通
初级用户
Credits 21
Posts 12
Joined 2008-01-20 18:00
18-year member
UID 109104
Gender Male
Status Offline
1. In `set /a S=%t%%%86400%%3600%%60 2>nul`, `%t%` is a variable. The `%%` is used to escape the percent sign in batch processing, so that the percent sign is treated as a literal character instead of a variable delimiter.

2. In `ping -n 2 127.0|set/p l= 已计时间: %H%:%M%:%S%`, `set/p l=` is used to read input from the pipe. It reads the output from the `ping` command and assigns it to the variable `l` while displaying the specified prompt "已计时间: %H%:%M%:%S%".

3. `set /a t+=1` is an increment operation in batch processing. It is equivalent to `set /a t=t+1`, which increments the value of the variable `t` by 1.
Floor 57 Posted 2008-04-09 15:16 ·  中国 浙江 温州 平阳县 电信
新手上路
Credits 16
Posts 8
Joined 2007-03-29 23:19
19-year member
UID 83322
Gender Male
Status Offline
Well, that's clear enough. Okay. Let's give it a thumbs up...
Floor 58 Posted 2008-04-09 17:47 ·  IANA 局域网IP(Private-Use)
新手上路
Credits 4
Posts 2
Joined 2007-10-23 20:27
18-year member
UID 100581
Gender Male
Status Offline
There is no fixed order in learning, and I am grateful for the provision of delayed learning.
Floor 59 Posted 2008-04-09 21:49 ·  中国 浙江 宁波 电信
新手上路
Credits 16
Posts 8
Joined 2007-12-28 20:50
18-year member
UID 107067
Gender Male
Status Offline
Take it first, digest it slowly
Floor 60 Posted 2008-04-11 00:07 ·  中国 广东 广州 白云区 电信
初级用户
Credits 25
Posts 11
Joined 2007-05-18 00:40
19-year member
UID 88882
Gender Male
Status Offline
Good post
Forum Jump: