Answers:
您只需传递文件夹或驱动器的名称即可
vlc dvd://d:
有关更多详细信息,请参阅命令行参考手册:https://www.videolan.org/doc/play-howto/en/ch04.html
我需要创建一个脚本来确定DVD所在的驱动器,是否有驱动器,以及是否有多个驱动器告诉用户它无法确定要执行的驱动器。这就是我想出的:
#Begin Script
Add-Type -AssemblyName System.Windows.Forms
function Get-CDDrives {
@(Get-WmiObject win32_logicaldisk -filter 'DriveType=5' |
ForEach-Object { $_.DeviceID })
}
$Drive = Get-CDDrives
if ($Drive.count -gt 1) {[System.Windows.Forms.MessageBox]::Show("Unfortunately, you have more than one DVD drive, and I'm not smart enough to know which one to use for you video." , "Error" , 0)}
if ($Drive.count -eq 1) {& "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" dvd:///"$Drive"\}
if ($Drive.count -lt 1) {[System.Windows.Forms.MessageBox]::Show("Hmmm... I can't seem to find a DVD drive on your computer." , "Error" , 0)}
#End Script