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:06
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Discussion] How much do you know about "set"? ------- Application Examples View 19,646 Replies 66
Original Poster Posted 2006-02-18 06:49 ·  中国 上海 浦东新区 电信
中级用户
★★
一看二跟三动手
Credits 396
Posts 188
Joined 2005-10-23 13:21
20-year member
UID 43919
From 上海
Status Offline
SET: Design DOS environment variables.
Usage: SET variable=[variable value]

[Discussion] "set" What do you know?--------Application examples
Requirements:
1. Add comments, use REM: or ::
2. Explain the tested environments passed
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +3 2006-12-05 22:07
Floor 2 Posted 2006-02-18 07:22 ·  中国 上海 浦东新区 电信
中级用户
★★
一看二跟三动手
Credits 396
Posts 188
Joined 2005-10-23 13:21
20-year member
UID 43919
From 上海
Status Offline
====== Open Directory.bat =======
set drv=C:\WINDOWS\system32
REM Set the variable named drv to be equal to the string C:\WINDOWS\system32 (the system32 directory in the WINDOWS folder on drive C).
start %drv%
REM Open the directory (open the system32 directory in the WINDOWS folder on drive C).
REM Tested on C drive XP passed
Floor 3 Posted 2006-02-18 19:09 ·  中国 陕西 渭南 电信
初级用户
Credits 50
Posts 19
Joined 2006-02-15 12:43
20-year member
UID 50392
Gender Male
Status Offline
Thanks, give it a thumbs up. After reading this post, I can broaden my thinking. I was half-baked and didn't understand the application of the SET command, but now I understand a bit more. The more such good posts, the better.
Floor 4 Posted 2006-02-25 12:27 ·  中国 上海 浦东新区 电信
中级用户
★★
一看二跟三动手
Credits 396
Posts 188
Joined 2005-10-23 13:21
20-year member
UID 43919
From 上海
Status Offline
Do you know what the difference is here?
=============TESTGHO.BAT=========
set LgDrv=1 start 2 A: 7 C: 10 D: 13 E: 16 F: 19 G: 22 H: 25 I: 28 J:
set LgDrv=%LgDrv% 31 K: 34 L: 37 M: 40 N: 43 O: 46 P: 49 Q: 52 R: 55 S: 58
set LgDrv=%LgDrv% T: 61 U: 64 V: 67 W: 70 X: 73 Y: 76 Z: 78

=============TEST.BAT=============
set LgDrv=start A: Z: Y: X: W: V: U: T: S: R: Q: P: O:
set LgDrv=%LgDrv% N: M: L: K: J: I: H: G: F: E: D: C: over

[ Last edited by dosz on 2006-2-25 at 12:29 ]
Floor 5 Posted 2006-03-14 18:36 ·  中国 福建 泉州 电信
初级用户
Credits 86
Posts 32
Joined 2006-01-27 15:56
20-year member
UID 49579
Status Offline
Why did this such a good post not have any follow-up?
Floor 6 Posted 2006-11-23 06:10
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Originally posted by dosz at 2006-2-25 00:27:
Do you know what the difference is here?
=============TESTGHO.BAT=========
set LgDrv=1 start 2 A: 7 C: 10 D: 13 E: 16 F: 19 G: 22 H: 25 I: 28 J:
set LgDrv=%LgDrv% 31 K: 34 L: 37 M: 40 N: 43 O: 46 P: 49 Q ...



Why did you stop talking? Really.
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 7 Posted 2006-12-05 21:51 ·  中国 云南 玉溪 电信
初级用户
Credits 28
Posts 12
Joined 2006-10-17 22:24
19-year member
UID 66155
Status Offline
Yeah, I've looked for many ways, but I didn't see relevant explanations. I raised it here, but there was no result.
Floor 8 Posted 2006-12-05 22:07 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Thanks to the LZ for creating such a valuable post, learned it~~~
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 9 Posted 2006-12-05 22:17 ·  中国 河南 洛阳 电信
银牌会员
★★★
Credits 1,455
Posts 712
Joined 2006-01-20 10:26
20-year member
UID 49246
Status Offline
Heheh heh, why did the original poster start a topic and then get interrupted and stop? You should continue, so many brothers are waiting.
Floor 10 Posted 2006-12-12 05:05 ·  中国 湖南 衡阳 电信
初级用户
Credits 20
Posts 10
Joined 2006-10-25 02:43
19-year member
UID 68135
Gender Male
Status Offline
No examples... Still not quite clear
Floor 11 Posted 2006-12-20 05:22 ·  中国 上海 嘉定区 电信
初级用户
Credits 100
Posts 46
Joined 2006-12-19 04:57
19-year member
UID 73922
Gender Male
Status Offline
Why is there no follow-up to such a good post?
Floor 12 Posted 2007-01-13 11:21 ·  中国 江西 景德镇 电信
初级用户
Credits 77
Posts 34
Joined 2007-01-11 04:58
19-year member
UID 76137
Gender Male
From 景德镇
Status Offline
Still not quite clear!
Floor 13 Posted 2007-01-25 00:20 ·  中国 湖南 衡阳 电信
中级用户
★★
Credits 322
Posts 144
Joined 2007-01-10 13:00
19-year member
UID 76062
Gender Male
Status Offline
Floor 14 Posted 2007-01-25 05:19 ·  中国 江苏 连云港 电信
高级用户
★★★
前进者
Credits 641
Posts 303
Joined 2007-01-10 02:57
19-year member
UID 76009
Gender Male
Status Offline
Not bad. I also want to know the following content.
我相信总有一天,总会遇到一个人可以相濡以沫、相吻以湿!
Floor 15 Posted 2007-02-08 05:02 ·  中国 湖南 长沙 雨花区 电信
新手上路
Credits 10
Posts 4
Joined 2007-02-08 02:14
19-year member
UID 78924
Gender Male
Status Offline
Born in the WIN era, the seven orifices of DOS are six open
1 2 3 5 Next ›
Forum Jump: