Coder Social home page Coder Social logo

hollasch / drives Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 194 KB

Windows command shell utility to print out status of all active drive letters

License: MIT License

C++ 99.12% CMake 0.88%
active-drive-letters drives c-plus-plus windows command-line command-line-tools

drives's Introduction

drives -- Print status of active windows drives

Description

This command-line tool prints the status of all active drive letters on Windows. It handles local drives, network-mapped drives, removable drives, and virtual drives (mapped via the subst command).

Usage

drives: Print Windows drive and volume information
usage : drives  [--json|-j] [--verbose|-v] [drive]
                [--help|-h|/?] [--version]

This program prints drive information for all devices, network mappings, DOS
devices, and drive substitutions (via the `subst` command).

Unless the `--json` option is supplied, the following drive values will be
printed, in this order:

    - Drive Letter
    - Label
    - Serial Number
    - Type (No root, Removable, Fixed, Remote, CD-ROM, or RAM Disk)
    - File System (for example, NTFS, FAT, or FAT32)
    - Volume GUID, drive substitution or target, or network mapping

The volume GUID can be used in a formal volume name, with the following form:

    \\?\Volume{GUID}\

Options
    [drive]
        Optional drive letter for specific drive report (colon optional). If no
        drive is specified, reports information for all drives.

    --help, -h, /?
        Print help information.

    --json, -j
        Print full drive information in JSON format. To understand the file
        system flags, see documentation for the Windows function
        GetVolumeInformationW().

    --verbose, -v
        Generally, print additional volume information. This switch is ignored
        if the `--json` option is supplied. Additional volume information
        includes the amount of free space and the total drive capacity.

    --version
        Print program version.

drives v3.0.0 | 2022-04-22 | https://github.com/hollasch/drives

Sample Output

C:\> drives
A: "Data"    69cc-bf14  Fixed      NTFS    0f355eb5-6b2d-4583-8c15-350f09a59add
B: "Backup"  182b-29c2  Fixed      NTFS    65b25216-ace2-4bc0-a768-00cd5ce46082
C: "System"  cf99-12f4  Fixed      NTFS    c25514ce-c902-460a-aee5-a15d63e154ca
D: "ESD-USB" a0f3-59a6  Fixed      FAT32   ca8f1d7e-f70c-40c3-b71f-6aad1b4f4848
E: -         9f8b-fd0f  Removable  FAT32   2b3413e6-3be6-4376-8d46-282aed06561b
F: "Data"    fa6f-f71d  Fixed      NTFS    === A:\setup\tools
G: "Games"   4fdd-258e  Fixed      NTFS    b4f4619b-838c-484e-96f8-05a1bfd96a7a
R: -         -          CD-ROM     -
S: "Scratch" 0083-3922  Fixed      NTFS    ce38d56e-b4c0-477f-b77c-866b629c0c87
V: "NAS3"    7f10-6416  Remote     NTFS    --> \\common\files
X: "Data"    2175-ff77  Remote     NTFS    --> \\klaatu\a$

Building

This project uses the CMake build tool. CMake is a meta-build system that locates and uses your local development tools to build the project if possible.

To build, first install [CMake][https://cmake.org/]. Then go to the project root directory and run the following command:

cmake -B build

This will locate your installed development tools and configure your project build in the build/ directory. After that, whenever you want a new build, run this command:

cmake --build build

This will build a debug version of the project, located in build/Debug/. To build a release version, run

cmake --build build --config release

You can find the built release executable in build/Release/.


Steve Hollasch [email protected]
https://github.com/hollasch/drives

drives's People

Contributors

hollasch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

drives's Issues

Add help flags

Once we add the verbose option, we'll need command-line help.

Need to be Aware of Drives Mapped with Subst

Some drive letters may be aliased to directories via the 'subst' command. Output should indicate whether a drive is mapped with the subst command, and where it actually points to.

Add verbose flag

Add -v and --verbose flag to print extended volume information.

Add machine-parseable output option

Add an option (possibly -m/--machine or -p/--parseable) to output full drive details in a way that is easily parseable from scripts or other programs. Something like:

A.label: "Volume 1"
A.name: "?\12345678-9876-5432-113399775544"
A.infoValid: true
A.serialNumber: 55641223
A.fileSystemType: "NTFS"
A.maxComponentLength: 260
A.fileSysFlags: 9aff1006
A.netMap: null

B.label: "Volume 2"
B.name: "?\af110048-11fd-a0a4-2202-14fdb04519f8"
B.infoValid: true
B.serialNumber: ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.