In regard to this thread I decided to write my own commandline tool to gather some drive information. This tool is written in VB6 and follows the "mountvol" - style in main. I did not try to reinvent a wheel but to cover more info and functions in one commandline tool. It uses pure API calls and is bound on their features and restrictions.
I will certainly name the used API calls and functions in particular if somebody is interested (don't want to open a VB-Thread).
It has been fully tested on my Win8.1 OS and partially on WinXP and WinVista. My time for coding was -and is still limited, although started several month before.
This post is intended to discuss if it's a senseless tool or if you think it has some kind of worth (am I in the right forum here?).
If deemed to be useful, what should be changed/deleted/added to improve it?
Which kind of information is not available? Some (error-) messages?
Here is a "short" description of zDInfo:
zDInfo without parameters:
An extended set of drive and partition information is displayed.
No elevation of the command prompt is needed.
zDInfo /ELEVATE [<any set of arguments below>]
Must be the first switch.
Opens a console in admin mode running zSDInfo.exe (COMSPEC /k).
All commands listed below can be passed with the /ELEVATE prefix to
grant elevated rights .
Stand-alone switches:
Any of these must be the first switch. Others will be ignored.
/VM:[{<DrvLetter>|<NTFS-DirectoryFolder>}] [<Guid>]
Associates a volume with a directory on another volume or a drive letter.
A Mountpoint may be a drive letter or a fully qualified directory on
another volume. Non-existing path structures will be created. To associate
a volume with a directory that has any files or subdirectories in it is
treated as an error. If a mountpoint contains a path to a mounted folder,
a ""Dir not empty"" error will be displayed, even if the directory is empty.
Elevated rights are required.
/VU:[{<Guid>|<DrvLetter>|<NTFS-DirectoryFolder>}]
Deletes a drive letter or a mounted NTFS-directory folder.
If a GUID is used, ALL associations will be deleted.
If input is a remote drive ""Net Use <Input> /d /y"" is called.
Elevated rights are required.
/L:[{<Guid>|<DrvLetter>}] [<VolumeLabel>]
Sets a volume label by passing a GUID or a drive letter.
By passing a GUID, writing to unmounted volumes is supported.
To write a VolumeLabel that contains spaces, doublequotes must be added.
An empty value or two consecutive doublequotes blanks the volume label.
Elevated rights may be required.
Optional filter switches that may be combined in a useful manner:
/DL:[{1|2}] = DiskGetDriveLayoutEx Filter:
if omitted show all detected Drvs and Parts.
1 show DiskGetDriveLayoutEx entries only (including CD/DVDRoms)
2 show unknown Devs/Parts only (retrieve drive/partition entries
of GUIDs or mapped DrvLetters not detected by DiskGetDriveLayoutEx)
A ""ud""-prefix followed by a count number is assigned for unknown devices
/DF:[{1|2}] = DriveOrPartition Filter:
if omitted show Drvs and PartEntries.
1 show Drvs only
2 show Parts only
/PF:[{1|2}] = Partition Filter:
if omitted show only PartEntries with PartNr > 0.
1 show all PartEntries with non-empty sizes (this option shows extended
partition info or partition entries invisible to mountmgr)
2 show all PartEntries (full DiskGetDriveLayoutEx)
/MF:[{1|2}] = Mount Filter:
if omitted show mounted and unmounted PartEntries.
1 show mounted PartEntries only
2 show unmounted PartEntries only
/TF:[{2|3|4|5|6}] = DriveType Filter:
if omitted show all DrvTypes.
2 show Removable Drvs only
3 show Fixed Drvs only
4 show Remote (network) Drvs only
5 show CD/DVD-Rom Drvs only
6 show Ramdisk Drvs only
/SF:[{B|K|M|G|T}] = SizeUnit Filter:
if omitted attempt to detect size units automatically.
B sizes as Bytes
K sizes as Kilobytes
M sizes as Megabytes
G sizes as Gigabytes
T sizes as Terabytes
/FF:[{1|2|3}] = VolumeFilesystemFlags Filter:
if omitted don't show FilesystemFlags.
1 show all FilesystemFlags
2 show Flags tagged as True for each partition
3 show Flags tagged as False for each partition
NOTES:
- Command line input is case-insensitive.
- Any input containing spaces must be surrounded by doublequotes.
- Drive letters can be passed without a disk designator and/or a backslash.
- Directory pathes must be fully qualified - no relative pathes are allowed.
- Errorlevels are supported. If no error occurs exitcode is 0.
On errors the exitcode is a two- or three digit number, where the first digit always
returns the procedure number. The remaining numbers return the corresponding
VB/API-Error.
- Output entry, DrvBusType: WinVista reports SATA drives as ATA. Win7 reports
SATA drives in PATA mode as ATA.
Some Examples:
Any of these commands can be prefixed with /ELEVATE
zdInfo /L:C "Lbl Space" Label of drive letter C:\ becomes Lbl Space
zdInfo /L:D "" Blank label of drive letter D:\
zDInfo /VM:Z <GUID> Associate a volume GUID with drive letter Z:\
zDInfo /VM:D:\tmp\MountZ <GUID> Associate a volume GUID with directory D:\tmp\MountZ
zDInfo /VM:"D:\tmp\Mount Z" <GUID> Associate a volume GUID with directory D:\tmp\Mount Z
zDInfo /VU:D Unmount drive letter D:\
zDInfo /FF:3 Default listing (Drvs and Parts); additionally show all VolumeFilesystemFlags
zDInfo /TF:3 Default listing (Drvs and Parts) but show fixed Drvs only
zDInfo /TF:3 /DF:2 Show partition entries of fixed Drvs
zDInfo /TF:3 /DF:2 /PF:2 Show ALL partition entries of fixed Drvs
zDInfo /TF:3 /DF:2 /PF:2 /MF:1 Show ALL partition entries of fixed Drvs if mounted
Here's a list of needed/used API's and supported output values:
- Latest version here (extract zDInfo.exe from zip archive) -