加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 00:30:08 所属栏目:Windows 来源:网络整理
导读:如何在 Windows下检测CLI中的当前媒体类型? (DVD-RW,BD-R等) 我尝试过使用wmic cdrom get / format:list但没有关于当前媒体类型的信息. 我想检测光盘是CD,DVD,BD,RW,DL ……等.在计算机下的Windows GUI中,我们可以根据光驱显示的图标查看信息. 此外,我找不
如何在 Windows下检测CLI中的当前媒体类型? (DVD-RW,BD-R等)

我尝试过使用wmic cdrom get / format:list但没有关于当前媒体类型的信息.

我想检测光盘是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=SCSICDROM&VEN_HL-DT-ST&PROD_BD-RE__BH12LS354&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=SCSICDROM&VEN_HL-DT-ST&PROD_BD-RE__BH12LS354&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 |选择*为我提供光驱的以下结果(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          : rootcimv2
__PATH               : PC-JAYrootcimv2: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-JAYrootcimv2:Win32_PhysicalMedia.Tag="\.CDROM0"
Options              : System.Management.ObjectGetOptions
ClassPath            : PC-JAYrootcimv2:Win32_PhysicalMedia
Properties           : {Capacity,Caption,CleanerMedia,CreationClassName...}
SystemProperties     : {__GENUS,__CLASS,__SUPERCLASS,__DYNASTY...}
Qualifiers           : {dynamic,Locale,provider,UUID}
Site                 :
Container            :

I want to detect if the disc is a CD,DL… etc. In
Windows GUI under Computer we can see the information according to the
icon displayed for the optical drive.

您拥有正确的命令,您寻找的信息位于“标题”字段下.

因此对于:

wmic cdrom get /format:list

在您的示例中,在Caption字段中,您可以看到它是BD-RE(蓝光可刻录)

Caption=HL-DT-ST BD-RE BH12LS35

对于你的第二个问题:

Also,I can’t find the meaning of the Availability and the
Capabilities values,if you know a document talking about it,it would
be great.

有关此类的描述和所有内容可在MSDN上找到:

Win32_CDROMDrive class (Windows)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读