如何在Windows下检测CLI中的当前媒体types? (DVD-RW,BD-R等)

如何在Windows下检测CLI中的当前媒体types? (DVD-RW,BD-R等)

我已经尝试使用wmic cdrom get / format:list,但没有关于当前媒体types的信息。

我想检测光盘是CD,DVD,BD,RW,DL等。在计算机下的Windows GUI中,我们可以根据显示的光驱图标来查看信息。

此外,我找不到“可用性”和“能力”值的含义,如果您知道某个文档在谈论它,那就太好了。

C:\>wmic cdrom get /format:lis Availability=3 Capabilities={3,4,7} CapabilityDescriptions={"Random Access"," Supports writing"," Supports Removable Media"} Caption=HL-DT-ST BD-RE BH12LS35 CompressionMethod=Unknown ConfigManagerErrorCode=0 ConfigManagerUserConfig=FALSE CreationClassName=Win32_CDROMDrive DefaultBlockSize= Description=CD-ROM Drive DeviceID=SCSI\CDROM&VEN_HL-DT-ST&PROD_BD-RE__BH12LS35\4&15828421&amp ;0&050000 Drive=G: DriveIntegrity=TRUE ErrorCleared= ErrorDescription= ErrorMethodology= FileSystemFlags= FileSystemFlagsEx=21757959 Id=G: InstallDate= LastErrorCode= Manufacturer=(Standard CD-ROM drives) MaxBlockSize= MaximumComponentLength=254 MaxMediaSize= MediaLoaded=TRUE MediaType=DVD Writer MfrAssignedRevisionLevel=1.00 MinBlockSize= Name=HL-DT-ST BD-RE BH12LS35 NeedsCleaning= NumberOfMediaSupported= PNPDeviceID=SCSI\CDROM&VEN_HL-DT-ST&PROD_BD-RE__BH12LS35\4&15828421& amp;0&050000 PowerManagementCapabilities= PowerManagementSupported= RevisionLevel= SCSIBus=5 SCSILogicalUnit=0 SCSIPort=0 SCSITargetId=0 SerialNumber= Size=39621033984 Status=OK StatusInfo= SystemCreationClassName=Win32_ComputerSystem SystemName=PC TransferRate=4363,63636363636 VolumeName=XMEN_D1 VolumeSerialNumber=8AF2C6DC 

编辑

运行Get-WmiObject Win32_PhysicalMedia | Select * Get-WmiObject Win32_PhysicalMedia | Select *给我以下结果的光驱(DVD在驱动器中):

 PSComputerName : PC-JAY __GENUS : 2 __CLASS : Win32_PhysicalMedia __SUPERCLASS : CIM_PhysicalMedia __DYNASTY : CIM_ManagedSystemElement __RELPATH : Win32_PhysicalMedia.Tag="\\\\.\\CDROM0" __PROPERTY_COUNT : 23 __DERIVATION : {CIM_PhysicalMedia, CIM_PhysicalComponent, CIM_PhysicalElement, CIM_ManagedSystemElement} __SERVER : PC-JAY __NAMESPACE : root\cimv2 __PATH : \\PC-JAY\root\cimv2:Win32_PhysicalMedia.Tag="\\\\.\\CDROM0" Capacity : Caption : CleanerMedia : CreationClassName : Description : HotSwappable : InstallDate : Manufacturer : MediaDescription : MediaType : Model : Name : OtherIdentifyingInfo : PartNumber : PoweredOn : Removable : Replaceable : SerialNumber : SKU : Status : Tag : \\.\CDROM0 Version : WriteProtectOn : Scope : System.Management.ManagementScope Path : \\PC-JAY\root\cimv2:Win32_PhysicalMedia.Tag="\\\\.\\CDROM0" Options : System.Management.ObjectGetOptions ClassPath : \\PC-JAY\root\cimv2:Win32_PhysicalMedia Properties : {Capacity, Caption, CleanerMedia, CreationClassName...} SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...} Qualifiers : {dynamic, Locale, provider, UUID} Site : Container : 

我想检测光盘是CD,DVD,BD,RW,DL等。在计算机下的Windows GUI中,我们可以根据光驱显示的图标看到信息。

你有正确的命令,你所寻找的信息是在“标题”字段下。

因此对于:

 wmic cdrom get /format:list 

在你的例子中,在标题字段,你可以看到它是一个BD-RE(蓝光可录

字幕= HL-DT-ST BD-RE BH12LS35

对于你的第二个问题:

此外,我找不到“可用性”和“能力”值的含义,如果您知道某个文档在谈论它,那就太好了。

有关这个类的描述和一切都可以在这里findMSDN:

Win32_CDROMDrive类(Windows)

可用性是媒体的能力,能力是你的能力。 所以:

Availability=3
Capabilities={3,4,7}
CapabilityDescriptions={"Random Access"," Supports writing"," Supports Removable Media"}

这意味着你目前的媒体只支持阅读,而不是写作。 “支持可移动媒体”可能并不意味着任何有用的东西。 基于Size=39621033984参数,你有一个标准的DVD-R加载。 DL将是双倍的,而蓝光更多。 尝试尝试不同的媒体,看看结果是什么。

你有没有尝试过下面的代码?

 Get-WmiObject win32_cdromdrive -Filter "MediaLoaded=True" | Select Drive, MediaType