![]() |
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-13 06:17 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » Help! |
| Printable Version 2,924 / 7 |
| Floor1 骨灰龙 | Posted 2004-02-06 00:00 |
| 中级用户 Posts 22 Credits 206 | |
|
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?
|
|
| Floor2 如是大师 | Posted 2004-02-06 00:00 |
| 元老会员 Posts 3,351 Credits 9,654 From 湖北 | |
|
What should it look like? Please explain!
|
|
| Floor3 Kinglion | Posted 2004-02-06 00:00 |
| 铂金会员 Posts 1,924 Credits 5,798 From 金獅電腦軟體工作室 | |
|
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.
|
|
| Floor4 MYS | Posted 2004-02-07 00:00 |
| 元老会员 Posts 1,637 Credits 5,170 From 广东佛山 | |
|
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.
|
|
| Floor5 骨灰龙 | Posted 2004-02-09 00:00 |
| 中级用户 Posts 22 Credits 206 | |
|
Then can I use a %systemroot%?
It's like this. del %systemroot%\temp\*.* /q /f |
|
| Floor6 MYS | Posted 2004-02-09 00:00 |
| 元老会员 Posts 1,637 Credits 5,170 From 广东佛山 | |
|
Is there an environment variable called systemroot? In DOS, you can use the SET command to find all environment variables.
|
|
| Floor7 Roy | Posted 2004-02-09 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
|
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 |
|
| Floor8 骨灰龙 | Posted 2004-02-11 00:00 |
| 中级用户 Posts 22 Credits 206 | |
|
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. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |