试试vbs,win10 自带的虚拟光驱测试可行。我的系统中右键是“弹出(&J)”- Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
- Set colDrives = objWMIService.ExecQuery("Select * From Win32_LogicalDisk where DriveType='5'")
- Set objShell = CreateObject("Shell.Application")
-
- For Each objDrive In colDrives
- Set objItems = objShell.NameSpace(objDrive.Name + "\").Self.Verbs
- For Each objVerb In objItems
- If Left(objVerb.Name, 5) = "Eject" Then objVerb.DoIt
- Next
- Next
复制代码
|