Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created December 1, 2011 23:24
Show Gist options
  • Save hidsh/1420660 to your computer and use it in GitHub Desktop.
Save hidsh/1420660 to your computer and use it in GitHub Desktop.
play dvd-iso using WinCDEmu and mpc
' play dvd iso
'
' 1. mount iso (using WinCDEmu)
' 2. launch mpc
' 3. unmount iso
'
MOUNTER="""C:\Program Files (x86)\WinCDEmu\batchmnt64.exe"""
DVD_DRV="v:"
PLAYER="C:\Users\g\Dropbox\apps\MPC-HomeCinema.1.5.2.3456.x64\mpc-hc64.exe"
'-----------------
' functions
'-----------------
Sub mount(sh)
sh.Run MOUNTER & " \\DEBIAN\hdd\video\ENTERPRISE_S3D4.ISO " & DVD_DRV,, True
End Sub
Sub umount(sh)
sh.Run MOUNTER & " /unmount " & DVD_DRV,,True
End Sub
Sub wait_for_activation(sh, app)
Do Until sh.AppActivate(app.ProcessID)
WScript.Sleep 500
Loop
End Sub
Sub wait_for_termination
Do
set proc=getobject("winmgmts:root\cimv2").execquery("select * from win32_process where name='wfica32.exe'")
wscript.sleep 500
Loop While proc.count = 1
End Sub
'-----------------
' main procedure
'-----------------
Set ws = WScript.CreateObject("WScript.Shell")
mount ws
ws.Run PLAYER & " " & DVD_DRV & " /dvd /play",,True
wait_for_termination
umount ws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment