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-24 03:13
中国DOS联盟论坛 » WinPE、PowerShell及其它命令行系统专区 » CMD [Learning] View 16,772 Replies 48
Floor 16 Posted 2008-01-29 08:29 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Variable Delay and Command Expansion
@echo off
::Display source code
more %0&pause
for /l %%a in (1 1 4) do set t=%time% & echo %random% /%t%/
echo -----------&pause>nul
setlocal enabledelayedexpansion
for /l %%a in (1 1 4) do set t=%time% & echo !random! /!t!/
endlocal
echo -----------&pause>nul
for /l %%a in (1 1 4) do set t2=%time% & call echo %%random%% /%t2%/ \%%t2%%\
echo -----------&pause>nul


Press any key to continue. . .
23520 //
23520 //
23520 //
23520 //
-----------
25655 / 3:22:09.42 /
23230 / 3:22:09.42 /
29496 / 3:22:09.42 /
30091 / 3:22:09.42 /
-----------
2940 // \ 3:22:16.28 \
12893 // \ 3:22:16.28 \
1357 // \ 3:22:16.28 \
28853 // \ 3:22:16.28 \
-----------

set n=1
set/a n+=1&call echo %%n%%&pause

2
Press any key to continue......


[ Last edited by plp626 on 2008-4-16 at 11:30 AM ]
Floor 17 Posted 2008-02-06 20:28 ·  中国 四川 泸州 联通
高级用户
★★★
Credits 609
Posts 374
Joined 2006-08-02 22:38
19-year member
UID 59720
Status Offline
Haha, inspired by plp626, I modified it into a bilingual HTML version.

@echo off

::wangwei-20080205-xg Bilingual CMD Command Quick Reference Manual
setlocal EnableDelayedExpansion
@echo Please wait, creating CMD command directory...
>CMD Command Quick Reference Manual.htm echo ^<center^>^<h1^>CMD Command Quick Reference Manual^</h1^>%username% in %date% %time%^</center^>^<br^>
>>CMD Command Quick Reference Manual.htm echo ^<table^>
for /f "delims=:" %%f in ('help^|findstr /n "^ASSOC"') do set head=%%f
set /a head-=1
if "%head%"=="0" (set head=) else set head=skip=%head%
for /f "%head% delims=" %%i in ('help') do (
set str=%%i & set name=!str:~0,9! & set desc=!str:~9!
echo.!name! | findstr /v "^[A-Z]" >nul && echo !desc! >>CMD Command Quick Reference Manual.htm
if errorlevel 1 echo ^</td^>^</tr^>^<tr^>^<td^>^<a href="#!name!"^>!name!^</a^>^</td^>^<td^>^ ^ ^ !desc!>>CMD Command Quick Reference Manual.htm
)
cls
>>CMD Command Quick Reference Manual.htm echo ^</td^>^</tr^>^</table^>^<br^>^<a href="#top"^>Back to Top^</a^>^<br^>
for /f %%i in ('help') do (
echo * * * * * * *>>CMD Command Quick Reference Manual.htm
echo.>>CMD Command Quick Reference Manual.htm
>>CMD Command Quick Reference Manual.htm echo ^<a name="%%i"^>^<h2^>%%i^</h2^>^<pre^>
cls
graftabl 936>nul
@echo Creating help for %%i command...
help %%i>>CMD Command Quick Reference Manual.htm
echo ────────────────────────>>CMD Command Quick Reference Manual.htm
echo English Translation:>>CMD Command Quick Reference Manual.htm
cls
chcp 437>nul
help %%i>>CMD Command Quick Reference Manual.htm
echo.>>CMD Command Quick Reference Manual.htm
>>CMD Command Quick Reference Manual.htm echo ^</td^>^</tr^>^</table^>^<br^>^<a href="#top"^>Back to Top^</a^>^<br^>
)
graftabl 936>nul
start CMD Command Quick Reference Manual.htm
Floor 18 Posted 2008-02-07 21:36 ·  中国 广东 广州 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
I think we can make a cmd & bat tutorial & DOS learning software selected collection. Actually, many tutorials are well-written, but they are too scattered. Many people can't find them. (This message can be deleted) I collected some good ones...http://523066680.ys168.com/
Floor 19 Posted 2008-02-08 11:05 ·  中国 湖北 宜昌 联通
初级用户
★★
Credits 177
Posts 85
Joined 2007-12-01 20:40
18-year member
UID 104378
Gender Male
Status Offline
Please look forward to it................................
Floor 20 Posted 2008-02-25 00:10 ·  中国 新疆 乌鲁木齐 电信
新手上路
Credits 18
Posts 9
Joined 2008-02-04 08:52
18-year member
UID 110164
Gender Male
Status Offline
Floor 21 Posted 2008-03-01 18:25 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Learning spirit... When we can explain some content of DOS, we can be considered to have learned that part of the content! Let's work together...
Floor 22 Posted 2008-03-15 02:08 ·  中国 广东 河源 电信
新手上路
Credits 16
Posts 9
Joined 2007-11-18 10:37
18-year member
UID 103009
Gender Male
Status Offline
Thanks for your sharing, I can't understand it very well, learning...
Floor 23 Posted 2008-03-19 15:21 ·  中国 黑龙江 大庆 联通
高级用户
★★
Credits 547
Posts 261
Joined 2006-04-15 16:50
20-year member
UID 53887
Status Offline
Although many people are confused, I am still very grateful! But I would like to make a suggestion. Since it is your own bit-by-bit study, can you explain it more simply and make the examples more clear?
Floor 24 Posted 2008-03-24 13:00 ·  中国 广东 东莞 电信
初级用户
Credits 20
Posts 10
Joined 2008-03-12 18:16
18-year member
UID 112769
Gender Male
From 江西
Status Offline
Thanks to the LZ for writing some basic things. Thanks to 523066680 for the treasures in the U disk. I'll go download them and study them.
Floor 25 Posted 2008-03-27 02:37 ·  中国 海南 海口 电信
初级用户
Credits 24
Posts 12
Joined 2006-03-17 02:12
20-year member
UID 52232
Status Offline
It's great. There are still many things in DOS that I haven't made good use of.
It's wonderful. The world of DOS is too big.
Love this forum to death.
Floor 26 Posted 2008-04-10 00:18 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,282
Posts 538
Joined 2002-11-02 00:00
23-year member
UID 129
Gender Male
Status Offline
This post is suitable for those who haven't mastered it yet to learn!
Floor 27 Posted 2008-04-11 12:55 ·  中国 四川 内江 电信
初级用户
★★
Credits 120
Posts 62
Joined 2008-04-11 09:52
18-year member
UID 115566
Gender Male
From 四川内江
Status Offline
Thanks for sharing
Floor 28 Posted 2008-04-19 18:37 ·  中国 福建 厦门 电信
初级用户
Credits 74
Posts 37
Joined 2007-06-28 11:47
18-year member
UID 92573
Gender Male
Status Offline
Floor 29 Posted 2008-04-26 14:18 ·  中国 辽宁 锦州 联通
中级用户
★★
Credits 228
Posts 106
Joined 2008-04-26 12:34
18-year member
UID 117003
Gender Male
Status Offline
This forum is really great, thanks to plp626.
Floor 30 Posted 2008-04-27 02:29 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
I still have some links here, not pasted.
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Forum Jump: