![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-10 15:59 |
47,811 topics / 349,897 posts / today 0 new / 48,255 members |
| DOS批处理 & 脚本技术(批处理室) » How to write %windir% into another batch file in batch processing |
| Printable Version 3,839 / 7 |
| Floor1 神仙贝贝 | Posted 2004-08-02 00:00 |
| 初级用户 Posts 16 Credits 167 | |
|
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 |
|
| Floor2 Climbing | Posted 2004-08-02 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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.
|
|
| Floor3 神仙贝贝 | Posted 2004-08-02 00:00 |
| 初级用户 Posts 16 Credits 167 | |
|
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
|
|
| Floor4 Climbing | Posted 2004-08-02 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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
|
|
| Floor5 神仙贝贝 | Posted 2004-08-02 00:00 |
| 初级用户 Posts 16 Credits 167 | |
|
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: |
|
| Floor6 Climbing | Posted 2004-08-02 00:00 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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.
|
|
| Floor7 神仙贝贝 | Posted 2004-08-03 00:00 |
| 初级用户 Posts 16 Credits 167 | |
| Floor8 defrag | Posted 2005-04-24 00:00 |
| 中级用户 Posts 570 Credits 456 | |
|
echo %%%%comspec%%%%
Displays: %%%%comspec%%%% |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |