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-22 12:00
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to write %windir% into another batch file in batch processing View 3,602 Replies 7
Original Poster Posted 2004-08-02 00:00 ·  中国 北京 263网络通信股份有限公司
初级用户
Credits 167
Posts 16
Joined 2004-07-06 00:00
21-year member
UID 27888
Gender Male
Status Offline
Hehe, ask a question, how to write %windir% into a.txt under the command line.

I originally thought c:\>echo %windir%>a.txt and then type a.txt to find out it's not the case, 55, what to do

Floor 2 Posted 2004-08-02 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
You are also an old forum member, but your post is still so non-standard. This problem is very simple, but I don't plan to answer you for now. Unless you can understand the post in my signature.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 3 Posted 2004-08-02 00:00 ·  中国 北京 263网络通信股份有限公司
初级用户
Credits 167
Posts 16
Joined 2004-07-06 00:00
21-year member
UID 27888
Gender Male
Status Offline
Well, got it. Tell me then. I'm so anxious and won't dare next time I just finished the college entrance examination this year and am self-studying these things. I didn't find any specialized books on this in the bookstore, 55. I remember I asked another question in a post last time, and you explained the question I asked above, but I really didn't understand, so I posted again today, 555. Did something wrong
Floor 4 Posted 2004-08-02 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Actually, you only need to change the title of a post, for example, change it to: How to output the %windir% string to another batch file in batch processing? And you should note in the post which Windows environment you operated in. Suggest you now modify the top post of yours, and next time you post, there's no need for me to remind you like this, right? Since I don't know which Windows you operated in, I tested with Windows xp/2003 DOS, and the following command is usable, and Windows 2000 should also be okay: echo %windir^% > a.txt
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 5 Posted 2004-08-02 00:00 ·  中国 北京 263网络通信股份有限公司
初级用户
Credits 167
Posts 16
Joined 2004-07-06 00:00
21-year member
UID 27888
Gender Male
Status Offline
Um, thanks, I've already changed it. I understand this. Do you still remember the question I asked last time? It was about having friends write a batch file comment. There was a part:
set drive=
set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z
echo @echo off >drivechk.bat
echo @prompt %%%%%%comspec%%%%%% /f /c vol %%%%%%1: $b find "Vol" > nul >{t}.bat
%comspec% /e:2048 /c {t}.bat >>drivechk.bat
del {t}.bat
echo if errorlevel 1 goto enddc >>drivechk.bat Although you've already explained it to me, I still don't understand why there are so many %%%%%% like %%%%%%comspec%%%%%% /f /c vol %%%%%%1:
Floor 6 Posted 2004-08-02 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Regarding the problem of the previous HDKP.bat, a netizen has already answered it carefully last time. You should study it carefully. Without the spirit of research, you can't learn anything and may not be able to succeed.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 7 Posted 2004-08-03 00:00 ·  中国 北京 263网络通信股份有限公司
初级用户
Credits 167
Posts 16
Joined 2004-07-06 00:00
21-year member
UID 27888
Gender Male
Status Offline
Floor 8 Posted 2005-04-24 00:00 ·  中国 山东 济宁 电信
中级用户
★★★
痴迷DOS者
Credits 456
Posts 570
Joined 2004-10-09 00:00
21-year member
UID 32281
Gender Male
Status Offline
echo %%%%comspec%%%%
Displays: %%%%comspec%%%%
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
Forum Jump: