Distinguish fixed hard drives from ext. removable HDs

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Distinguish fixed hard drives from ext. removable HDs

Post by klownboy »

There's been some past history on this topic, but....I've noticed that using SC get("drives", 2, "|")) will feedback the removable flash drives but not the "removable external" disk (hard) drives, at least not for me. Using get("drives", 3, "|") results in all the fixed "internal" hard drives (in my case example C:\ and D:\), but will also give the external removable USB hard drives like a WD 640 Western Digital external removable USB interface hard drive so the result is C:\|D:\|F:\. Is there any known or established SC way to separate or distinguish the known physical fixed (i.e., in the laptop or desktop (C:\ and D:\) from the "removable external" drives, but not detected as "removal" using get("drives", 2, "|"). Would I have to eliminate the 2 known "physically installed" drives C:\ and D:\, which unfortunately will be different for each computer (so a modified script), from the full list provided using get("drives", 3, "|")? I've been looking, but I don't know of any XY or system variable which give me just the installed fixed hard drives.
Thanks,
Ken

admin
Site Admin
Posts: 66360
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Distinguish fixed hard drives from ext. removable HDs

Post by admin »

Not possible ATM. The standard Windows function for this is lying, and it is quite complex to get the truth here out of Windows. One day...

Post Reply