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-08-13 07:02
Original Poster Posted 2004-02-06 00:00 ·  中国 山西 太原 联通
中级用户
Credits 206
Posts 22
Joined 2004-02-05 00:00
22-year member
UID 16772
Gender Male
Status Offline
I want to know how to automatically find the Windows installation directory under the DOS prompt. For example, in a batch file, I need to automatically add a file to the system directory. But the system directory is not necessarily C:\WINDOWS\ or C:\WINNT\. How to do this?
Floor 2 Posted 2004-02-06 00:00 ·  中国 湖北 武汉 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
What should it look like? Please explain!
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 3 Posted 2004-02-06 00:00 ·  中国 辽宁 沈阳 联通
铂金会员
★★★★
痴迷DOS者
Credits 5,798
Posts 1,924
Joined 2003-06-20 00:00
23-year member
UID 5583
Gender Male
From 金獅電腦軟體工作室
Status Offline
It seems there is an environment variable called WINDIR, and the value of this variable is the installation directory of WINDOWS. I can't remember clearly. Please help think about it.
熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
Floor 4 Posted 2004-02-07 00:00 ·  中国 广东 佛山 三水区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
Yes, you can use %WINRAR% to find the Windows installation directory. If you want to copy a file to this directory, you can use: copy XXXX.XXX %WINDIR% and note that WINDIR must be in uppercase.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 5 Posted 2004-02-09 00:00 ·  中国 山西 太原 联通
中级用户
Credits 206
Posts 22
Joined 2004-02-05 00:00
22-year member
UID 16772
Gender Male
Status Offline
Then can I use a %systemroot%?

It's like this.
del %systemroot%\temp\*.* /q /f
Floor 6 Posted 2004-02-09 00:00 ·  中国 广东 佛山 三水区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
Is there an environment variable called systemroot? In DOS, you can use the SET command to find all environment variables.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 7 Posted 2004-02-09 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
Below is the quote from Gu Huo Long on 2004-2-9 9:07:26:
Can I use a %systemroot% then?

This is the case.
del%systemroot%\temp\*.*/q/f

Then it's better to use %temp%

Below is the quote from mys on 2004-2-9 11:41:33:
Is there the systemroot environment variable? You can use the SET command under DOS to find out all environment variables.

It exists in NT based systems


我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 8 Posted 2004-02-11 00:00 ·  中国 山西 太原 联通
中级用户
Credits 206
Posts 22
Joined 2004-02-05 00:00
22-year member
UID 16772
Gender Male
Status Offline
That %SYSTEMROOT% cannot be found in the variables, but it can be used.

SORRY. I mean it can be used in the command prompt of XP, WIN2003. Maybe it's a system - reserved one.
Forum Jump: