CD-RW / DVD-RW drive query

(imported topic written by SystemAdmin)

Hello all,

I am trying to create a property or get a list of all writable drives I attempted to do it like this.

It is my understanding that there is a registry key that says if a drive is writable or not.

http://support.microsoft.com/kb/316529

I tried to create this because the volume key is not a constant but when it runs all of them just say not reported.

values “0x00000002” of keys “Drive Type” of keys of keys “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives” of registry

Any help or other ideas would be amazing.

Thank you

(imported comment written by lmpymilk91)

this should work

To get the parent key name you could do something like this.

(names of (keys whose (exists value “Drive Type” whose (it as string is “2” of it) of it) of key “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives” of registry) as string)

but as it says in the kb link you posted this will provide “Volume{GUID}”

Are you wanting the drive letter or the drive name?

(imported comment written by SystemAdmin)

Thanks,

I will give it a shot when i get to work tomorrow

No I don’t need to know the drive letter or name

I just need to know which computers have a drive that is writable, Ideally I would like to know the value of Drive Type for all computers

(imported comment written by lmpymilk91)

OK - So you just want to know if it exists. Then you can use something like this…

(exists(keys whose (exists value “Drive Type” whose (it as string is “2” of it) of it) of key “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives” of registry))

An issue that you might have is that you’re looking in the HKCU key. That key may not exist at the time you try collecting the information.

(imported comment written by SystemAdmin)

I got an error for all of them

I just want to make sure that I am not forgetting the need for a wild card or something when it comes to the Volume{64d3d110-f16f-11dd-99e2-806d6172696f} part of the registry?

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives\Volume{64d3d110-f16f-11dd-99e2-806d6172696f}

(imported comment written by jessewk)

Remember that the client runs as System so HKCU is different in the relevance debugger than it is from the client perspective.

This will get you the name of all the “Drives” keys anywhere in the HKEY_USERS hive followed by the “Drive Type” identifier:

Q: (name of it, value “Drive Type” of it) of keys whose (exists values “Drive Type” of it) of keys “Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives” of keys of key “HKEY_USERS” of registry

A: Volume{18ad551a-c40e-11de-9abe-806e6f6e6963}, 16