Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Where is %SystemDrive%?

56 views
Skip to first unread message

Steffen Haugk

unread,
Oct 22, 2003, 5:02:43 AM10/22/03
to
Silly question: Where is %SystemDrive%?

For example
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysmonLog\DefaultLogFileFolder
is set to

%SystemDrive%\PerfLogs

but where is that?


In contrast,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\PathName
is set to

%systemroot%\system32

and I know where %systemroot% is, because
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SystemRoot
is set to

C:\WINNT

That makes sense.

I know it's kind of stupid, but I can't find %systemdrive%.

Thanks everyone.
Steffen

Mark V

unread,
Oct 22, 2003, 11:17:38 AM10/22/03
to
Steffen Haugk wrote in
news:i7hcpvc1dg1m1scha...@4ax.com:

> Silly question: Where is %SystemDrive%?
>
> For example
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysmonLog\Defa

> ultLogFileFolder is set to

>
> %SystemDrive%\PerfLogs
>
> but where is that?
>
>
> In contrast,
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\PathName
> is set to
>
> %systemroot%\system32
>
> and I know where %systemroot% is, because
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> NT\CurrentVersion\SystemRoot
> is set to
>
> C:\WINNT
>
> That makes sense.
>
> I know it's kind of stupid, but I can't find %systemdrive%.

Open a cmd.exe prompt.
Enter SET

The %systemdrive% should have a value of the "boot" drive. Often
this is "C:". The drive that contains %systemroot% (the Windows
Installation location).

Peter Z.

unread,
Oct 22, 2003, 1:45:00 PM10/22/03
to
There are no silly questions. Only silly people who refuse to ask when
they don't know.

%systemdrive% is where the primary boot volume and OS are. So if you
install it to the default it will be C:\

Cheers
Peter Z.

Steffen Haugk <stef...@cushat.com> wrote in message news:<i7hcpvc1dg1m1scha...@4ax.com>...

Steffen Haugk

unread,
Nov 4, 2003, 9:00:51 AM11/4/03
to

On Wed, 22 Oct 2003 08:17:38 -0700, Mark V <notv...@invalid.nul>
wrote:

>Steffen Haugk wrote in
>news:i7hcpvc1dg1m1scha...@4ax.com:
>
>>

>> I know it's kind of stupid, but I can't find %systemdrive%.
>
>Open a cmd.exe prompt.
>Enter SET
>
>The %systemdrive% should have a value of the "boot" drive. Often
>this is "C:". The drive that contains %systemroot% (the Windows
>Installation location).

I can not (or better, want not) run SET on a remote machine from my
program. I can happily connect to a remote computer's registry and get
%systemroot%.

I assume that %systemdrive% is the drive letter part of %systemroot%.
Although that makes sense, I wonder if that is the official way to do
it, and if that is the official way in which %systemdrive% is to be
interpreted.


Thanks for the reply.

Steffen

Steffen Haugk

unread,
Nov 4, 2003, 9:01:42 AM11/4/03
to
On 22 Oct 2003 10:45:00 -0700, pete...@hotmail.com (Peter Z.) wrote:

>There are no silly questions. Only silly people who refuse to ask when
>they don't know.
>
>%systemdrive% is where the primary boot volume and OS are. So if you
>install it to the default it will be C:\

It seems funny to use a variable %systemdrive% in the registry and not
defining it anywhere.

Thanks,
Steffen

Mark V

unread,
Nov 4, 2003, 9:24:47 AM11/4/03
to

There are several variables that are created by the system at boot
time and are assigned dynamically. These are not defined (hard-
coded) anywhere. They are "defined" and visible in the local
machine's environment space. %systemdrive% is available if you can
read the local environment (on a remote system). psinfo.exe is an
example. psexec.exe is another way to see a "local" environment.

If you must read the remote registry to determine the "systemdrive" I
suggest

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\

SystemRoot=
(a REG_SZ) value. Then parse out the drive letter.

Steffen Haugk

unread,
Nov 5, 2003, 6:18:53 AM11/5/03
to
Thanks all,
I am satisfied I haven't missed anything. If systemroot is c:\winnt it
is kind of logical that systemdrive is c:, isn't it?

But why introducing it at all, when it is so obvious?
Why is systemroot not defined as &systemdrive%\winnt?

The weird world of Windows.

Thanks again,
Steffen

On Tue, 04 Nov 2003 06:24:47 -0800, Mark V <notv...@invalid.nul>
wrote:

Mark V

unread,
Nov 5, 2003, 9:27:00 AM11/5/03
to
In microsoft.public.win2000.registry Steffen Haugk wrote:

> Thanks all,
> I am satisfied I haven't missed anything. If systemroot is
> c:\winnt it is kind of logical that systemdrive is c:, isn't it?
>
> But why introducing it at all, when it is so obvious?
> Why is systemroot not defined as &systemdrive%\winnt?

A good question to which I have not the answer. :-)

It may be (hypothetical) that this derives from design decisions made
in the original NT developement.

0 new messages