Disks to letters


  1. Posts : 24
    Windows 10
       #1

    Disks to letters


    Good guys, I'm here with a doubt if you can clarify. I need a command (cmd.exe) to export the following command to a .txt file in which on disk 0 which drive letters are attached to it.

    This is just an example:

    On disk 0 it is C: and D:
      My Computer


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #2

    This won't output in the format you are looking for, but it will show all volumes on a disk. If those volumes have drive letters associated with them, they will be shown as well.

    Copy the following text into a file:

    Code:
    @echo off
    cd /d %~dp0
    
    (echo select disk 0
    echo detail disk
    echo exit
    ) | diskpart > results.txt
    Name the file something like "GetDiskInfo.bat"

    Run that batch file as administrator (right-click, choose Run as administrator).
    A file named "results.txt" will be created in the same folder where the batch file was run from. At the end you will see all volumes with associated drive letters listed.

    I hope that's close enough to what you are looking for!
      My Computers


  3. Posts : 24
    Windows 10
    Thread Starter
       #3

    hsehestedt said:
    This won't output in the format you are looking for, but it will show all volumes on a disk. If those volumes have drive letters associated with them, they will be shown as well.

    Copy the following text into a file:

    Code:
    @echo off
    cd /d %~dp0
    
    (echo select disk 0
    echo detail disk
    echo exit
    ) | diskpart > results.txt
    Name the file something like "GetDiskInfo.bat"

    Run that batch file as administrator (right-click, choose Run as administrator).
    A file named "results.txt" will be created in the same folder where the batch file was run from. At the end you will see all volumes with associated drive letters listed.

    I hope that's close enough to what you are looking for!
    hsehestedt thanks
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:24.
Find Us




Windows 10 Forums