How to get the volume GUID of a drive

Windows assigns each drive a Volume GUID for each drive in a computer.  For example, the C: drive might be \\?\Volume{9d573eb6-aa70-11e1-9b4f-0050563b9b3c}\.

I wanted to setup a schedule to automatically defrag multiple 13 hard drives on a server.  The default task scheduler built into the Disk Defragmenter interface will only allow you setup one schedule item.  In my case where I have multiple hard drives, setting one task item up for 13 drives that are actively used daily by hundreds of users could take the event several hours to complete.  That will not work.  So I need to setup a schedule to do this with only a few drives per night but I need the GUID first.

Here is how to get the GUID quick and easy.

Open Command Line and type the following



You can also save this list to a text file by adding “> [fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”][directory and filename]” to the command.

For example:

c:\mountvol > c:\IT-Folder\disk_volume_list.txt

This will create a text file called “disk_volume_list.txt” in the directory C:\IT-Folder



If you want to know how I scheduled the Defrag task, checkout this post here.


1 thought on “How to get the volume GUID of a drive”

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: