Relevance to detect windows is installed on Disk0 and Partition0

(imported topic written by whoseit91)

Hello can any one help me in identifying how to check if windows is installed on drive0 and partition 0. I want to ensure the system is not dual boot and if it is it is not relevant?

I have been using the following code as a start

(string value of property “Antecedent” of it & “||” & string value of property “Dependent” of it) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi

It shows “Disk #0, Partition #0” and “C:” so wanted to ask are these linked or have I just appended them ie can I assume if they are in the same result line that C: is Disk 0 Partition 0 and then If that was the case I was going to compare if

name of drive of windows folder

result matched the Drive of the wmi query.

Maybe I am tackling this from the incorrect starting point.

I suppose I could just check that there is just one drive and one partition.

Thanks in advance.

(imported comment written by BenKus)

I think you are probably on the right track… The way you have built your query, the “Antecedent” and the “Dependent” objects will come from the same partition…

Perhaps this is close to what you want?

exists ((string value of property “Antecedent” of it & “||” & string value of property “Dependent” of it) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi) whose (it contains (name of drive of windows folder) AND (it does not contain “Disk #0, Partition #0”))

Ben

1 Like

(imported comment written by whoseit91)

Thank you