Jump to content

Get associated Disk & Patition for unmounted mountpoint


Recommended Posts

This code will return all unmounted mountpoints for EFI System partitions. How do I get the associated Disk# and partition # for each unmounted mountpoint ?.

The same as with Diskext.exe from Sysnternals.

Please advise. Thanks

#include <Array.au3>
global $aResult = ""

; Script Start - Add your code below here
$WMIService = ObjGet("winmgmts:\\.\root\cimv2")
$WMIVolumes = $WMIService.ExecQuery("Select * from Win32_Volume")
If IsObj($WMIVolumes) Then
    For $Volume in $WMIVolumes
        if ($Volume.Name = $Volume.DeviceID)  and ($Volume.FileSystem = "FAT32") then
            $aResult  &= $Volume.FileSystem & ":     " & $Volume.Name & @CR
        endif
    Next
    _ArrayDisplay(StringSplit($aResult, @CR, 2), "Unmounted Partitions")
EndIf

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...