最新消息:

CDRom为NSIS提供CD光驱操作功能

nsis 永恒心锁 1704浏览 0评论
/*
CDRom为NSIS提供CD光驱操作功能
功能介绍:
*打开或关闭CD-ROM,cdrom::Close,cdrom::Open
*获得CD-ROM的状态,比如是否准备好cdrom::Status
*获得CD-ROM的相关信息,卷标,卷标序列号cdrom::VolumeName,cdrom::VolumeSerialNumber
*遍历系统所有的CD-ROM个数cdrom::FindNext,cdrom::FindClose
*/
!AddPluginDir "../Plugin"
Name "CDRomTest"
OutFile "CDRomTest.exe"
Section
# Enumerate CD-ROMs
loop:
cdrom::FindNext /NOUNLOAD .r0
MessageBox MB_YESNO "cdrom::FindNext$n$n
Errorlevel: [$0]$n$n
Choose this CD drive for test?" IDNO loop
cdrom::FindClose
#Open CD-ROM door
cdrom::Open "$0" .R0
MessageBox MB_OK "cdrom::OpenCD$n$n
Errorlevel: [$R0]"
# Close CD-ROM door
cdrom::Close "$0" .R0
MessageBox MB_OK "cdrom::CloseCD$n$n
Errorlevel: [$R0]"
# Get CD-ROM status
cdrom::Status "$0" .R0
MessageBox MB_OK "cdrom::StatusCD$n$n
Errorlevel: [$R0]"
# Get CD-ROM volume name
cdrom::VolumeName "$0" .R0
MessageBox MB_OK "cdrom::VolumeName$n$n
Errorlevel: [$R0]"
# Get CD-ROM volume serial number
cdrom::VolumeSerialNumber "$0" .R0
MessageBox MB_OK "cdrom::VolumeSerialNumber$n$n
Errorlevel: [$R0]"
SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » CDRom为NSIS提供CD光驱操作功能

您必须 登录 才能发表评论!