Parsing a file from Mountvol

(imported topic written by SystemAdmin)

Im trying to gather all the Mount points from systems for backup purposes,

when I run mountvol I get output like below, I would just like to parse out “E:\inetpub”, anything that isn’t a drive letter only

im looking for any to do this, WMI would also be fine

Creates, deletes, or lists a volume mount point.   MOUNTVOL [drive:]path VolumeName MOUNTVOL [drive:]path /D MOUNTVOL [drive:]path /L MOUNTVOL [drive:]path /P MOUNTVOL /R MOUNTVOL /N MOUNTVOL /E   path        Specifies the existing NTFS directory where the mount point will reside. VolumeName  Specifies the volume name that is the target of the mount point. /D          Removes the volume mount point from the specified directory. /L          Lists the mounted volume name 

for the specified directory. /P          Removes the volume mount point from the specified directory, dismounts the volume, and makes the volume not mountable. You can make the volume mountable again by creating a volume mount point. /R          Removes volume mount point directories and registry settings 

for volumes that are no longer in the system. /N          Disables automatic mounting of 

new volumes. /E          Re-enables automatic mounting of 

new volumes.   Possible values 

for VolumeName along with current mount points are:   \\?\Volume
{db8f8c9c-e247-11dd-a25f-806e6f6e6963
}\ C:\   \\?\Volume
{9af52c76-e27d-11dd-859c-505054503030
}\ E:\   \\?\Volume
{9af52c78-e27d-11dd-859c-505054503030
}\ F:\   \\?\Volume
{db8f8c9b-e247-11dd-a25f-806e6f6e6963
}\ D:\   \\?\Volume
{db8f8c9a-e247-11dd-a25f-806e6f6e6963
}\ A:\   \\?\Volume
{b6be8478-90be-4599-98f7-0a68ec99d9fb
}\ G:\ E:\inetpub\

(imported comment written by SystemAdmin)

How would I pull the bold line below, i assume if it more then 4 chars, or if there’s something after “:\”

I just want to return “E:\inetpub”

(string values of selects “Directory from Win32_MountPoint” of wmi)

Win32_Directory.Name=“C:\”

Win32_Directory.Name=“E:\”

Win32_Directory.Name=“F:\”

Win32_Directory.Name=“D:\”

Win32_Directory.Name=“A:\”

Win32_Directory.Name=“G:\”

Win32_Directory.Name=“E:\inetpub”

Win32_Directory.Name=“H:\”

Win32_Directory.Name=“I:\”

(imported comment written by NoahSalzman)

OK, if you are assuming something after \ then

(following texts of firsts “=” of (string values … )) whose (length of it > 6)

(imported comment written by SystemAdmin)

Thanks Noah,

This will be helpful,

Our backup guy asked if I could get a list of all the mount points, because the backup software is setup not to backup these mounted disks

Relevance:

concatenation "; " of unique values of (substrings between “%22” of (following texts of firsts “=” of ((string values of selects "directory from Win32_MountPoint " of wmi))) whose (length of it > 6))

server01 F:\DataMntPt; F:\SysMntPt

server02 H:\DataMntpt; H:\LogMntpt; H:\SysMntpt; H:\TempMntpt

server03 F:\DataMntPt; F:\SysMntPt

server04 F:\SysMntPt; G:\DataMntPt; G:\LogMntPt; G:\SysMntPt; G:\TempMntPt; H:\DataMntPt; H:\LogMntPt; H:\SysMntPt; H:\TempMntPt

server05 F:\DataMntPt; F:\SysMntPt

I would like to get rid of the double back slashes…

(imported comment written by BenKus)

You want to swap out the double backslashes for single backslashes? If so, add this to the front of your expression:

concatenation “” of substrings separated by “\” of …

Ben

(imported comment written by SystemAdmin)

Thank You

concatenation “” of substrings separated by “\” of (concatenation "; " of unique values of (substrings between “%22” of (following texts of firsts “=” of ((string values of selects "directory from Win32_MountPoint " of wmi))) whose (length of it > 6)))

1 issue is this wmi call only works on 2003+ windows 2000 gives an error