How to find system drive on windows?

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 118
Joined: Thu May 02, 2019 11:53 am

How to find system drive on windows?

Post by amyren »

On Amiga systems we can use sys: to adress the system drive.

But how to find the system drive on a window system, in the odd cases this is not c: ?
The same question also applies for locations like Desktop, Appdata, Documents etc for current user

User avatar
airsoftsoftwair
Posts: 4350
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to find system drive on windows?

Post by airsoftsoftwair »

Take a look at GetSystemInfo().

plouf
Posts: 136
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: How to find system drive on windows?

Post by plouf »

best option is Andreas suggestion
just want to add that under windows there is also %windir% which point always to system path

cd %windir% -> C:\Windows (or whatever)
Christos

amyren
Posts: 118
Joined: Thu May 02, 2019 11:53 am

Re: How to find system drive on windows?

Post by amyren »

Thanks.
GetSystemInfo() does not seem to have option to get the Desktop path (user or common), nor the system drive.¨
But in my case I think CommonAppData and MyDocuments will do what I want this time.

%windir% is already covered by the GetSystemInfo() command
%systemdrive% is also used in windows, but I am not sure if and how these shortcuts can be used from Hollywood.

User avatar
airsoftsoftwair
Posts: 4350
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to find system drive on windows?

Post by airsoftsoftwair »

amyren wrote:
Thu Aug 13, 2020 12:40 pm
Thanks.
GetSystemInfo() does not seem to have option to get the Desktop path (user or common), nor the system drive.¨
But in my case I think CommonAppData and MyDocuments will do what I want this time.

%windir% is already covered by the GetSystemInfo() command
%systemdrive% is also used in windows, but I am not sure if and how these shortcuts can be used from Hollywood.
Sure, you can. There's a GetEnv() command for that, e.g.

Code: Select all

DebugPrint(GetEnv("systemdrive"))
Prints "C" here.

Post Reply