Is it possible to find how many titles in a dvd with a powershell script?

Cody Ferguson 96 Reputation points
2020-12-16T02:17:38.463+00:00

I basically want to do be able to convert dvds automatically.
I'm sure powershell can't do it natively, but if wrong, please tell me and comment the script.
The loop command I made myself.
$T is how many titles

Detects if dvd is in burner/reader $r = (Get-WMIObject -Class Win32_CDROMDrive -Property *).MediaLoaded if ($r -eq 'true') { $T = $h = 1 loop $T { #Records 1 episode on dvd vlc "dvdsimple:///D:/#$h" --sout "#duplicate{dst=std{access=file,mux=mp4,dst=C:\Users\Codyl\Videos\SG1 sh $h.mp4}" $h += 1 } }

Windows for business | Windows Server | User experience | PowerShell
{count} votes

Accepted answer
  1. Cody Ferguson 96 Reputation points
    2020-12-19T00:14:01.177+00:00

    I finally got it.

    function Find-NumofTitles {
        param (
            [string]$drive
        )
            $bytes=Format-Hex "${drive}:\VIDEO_TS\VTS_01_0.IFO"
            $d=($bytes|Select-String -Pattern "00000800")
            $s="$d"
            $s=$s.replace(" ","")
            $s=$s.Substring(8,4)
            [uint32]"0x$s"
    }
    

    You put the drive letter of the dvd without the colon (:) and then it'll tell you how many MAIN titles there are.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.