![]() |
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-12 14:20 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » Discussion on the differences between the environment variables [systemdrive] and [homedrive] |
| Printable Version 1,686 / 6 |
| Floor1 flyinspace | Posted 2007-10-05 22:24 |
| 银牌会员 Posts 517 Credits 1,206 | |
|
First of all, here I'm just repeating old stuff:
%systemdrive%: the disk partition where the system is installed %homedrive%: the partition where the current user's system is located When we see these two variables, in most cases, the values of these two variables are the same Their values are usually c: So, some people don't understand. Since these two values are the same, why are there two variables? Then, we should explain from the names of these two variables. systemdrive, from the name, is the drive letter of the partition where Windows is installed when Windows is installed.. homedrive is the directory where the configuration files of the currently logged-in user are stored: Usually our user configuration files are as follows. Suppose the user name is user and Windows is installed on drive C: c:\Documents and Settings\User Hehe, but if we change the user's configuration files to another place and put them on drive D, then our user configuration files become: d:\Documents and Settings\User At this time, the value of our homedrive becomes d: Well, my discussion is here. Welcome everyone to correct my mistakes: |
|
| Floor2 HAT | Posted 2007-10-05 22:42 |
| 版主 Posts 5,017 Credits 9,023 | |
|
Didn't someone just post and discuss this issue the other day?
|
|
| Floor3 lianjiang2004 | Posted 2007-10-05 23:59 |
| 金牌会员 Posts 1,884 Credits 3,946 | |
|
In this way, I understand. Thanks.
|
|
| Floor4 forumz | Posted 2007-11-12 17:42 |
| 初级用户 Posts 24 Credits 176 | |
|
Are there any other variables that indicate the system's boot partition besides these two variables related to the system partition? For example, the partition where files like ntdect.com and boot.ini are located. Although generally this partition corresponds to drive letter C, I want to write a more general way to handle situations.
|
|
| Floor5 plp626 | Posted 2010-03-13 02:01 |
| 银牌会员 Posts 1,020 Credits 2,278 | |
Originally posted by flyinspace at 2007-10-5 10:24 PM: It's an old post. When I look at it again, I realize it's not like this on my side... My set
[ Last edited by plp626 on 2010-3-13 at 02:03 ] |
|
| Floor6 jarry0932 | Posted 2010-03-14 00:13 |
| 初级用户 Posts 122 Credits 128 | |
|
Then both %systemroot% and %windir% refer to C:\windows. Are there any differences in some cases?
|
|
| Floor7 Hanyeguxing | Posted 2010-03-14 14:49 |
| 银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂 | |
|
%SYSTEMDRIVE% System Returns the drive that contains the root directory of Windows XP (that is, the system root directory).
%SYSTEMROOT% System Returns the location of the Windows XP root directory. %WINDIR% System Returns the location of the operating system directory. Purely from the system's perspective, %SYSTEMROOT% can only be used in systems after 2000, while %WINDIR% can be compatible with 95. Variables like %HOME...% are mainly used for returns within the domain, and other variables are only used for local returns. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |