Menu

Indeo codec powershell script

2023-06-07
2023-06-13
1 2 3 > >> (Page 1 of 3)
  • dippy dipper

    dippy dipper - 2023-06-07

    Critical Update:
    Removed the "-NoNewLine" command from the script and replaced it with another equivalent method. This command was introduced in PowerShell 5.0 and if the script was run with an older version (for example with Win8) then it would produce bad .reg files. This updated script should work with the older PowerShell versions as well (Tested with PS v.2.0).


    This is a Powershell script for enabling / disabling the Windows built-in Indeo codecs.

    • It checks the OS build version number to determine that it is running on Windows 8 or newer.
    • It checks for OS bits 32 or 64.
    • It verifies that the file ir50_32original.dll exists in the system directory.
    • If all the above variables are OK it spits out .reg files for disabling and enabling the Indeo codecs.

    Probably many more improvements could be done but for now I am leaving this working but crude PowerShell script here. You can copy the code into Notepad and save it as ps-indeo-codec.ps1. To run a PowerShell script you need to right click on it and choose "Run with PowerShell".

    # This script should be in a file with a .ps1 extension (e.g. indeo.ps1).
    # To run this script right click on it and choose "Run with PowerShell" 
    # or if your system does not allow running unsigned ps1 scripts you can use the command: 
    # "powershell.exe -noprofile -executionpolicy bypass -file .\indeo.ps1"
    # Do not edit this file unless you know what you are doing.
    ###########################################################
    
    Write-Host "Indeo codec enabler/disabler for Win8-Win11"
    Write-Host "-------------------------------------------`n"
    Write-Host "This PowerShell script will generate .reg files to enable or 
    disable the built-in Indeo codecs for Windows 8, 10 and 11:
    - Intel Indeo(R) Video R3.2
    - Intel Indeo(R) Video 4.5
    - Indeo(R)-video 5.10
    - Indeo(R) audio software
    `n"
    Write-Host "Disclaimer: Microsoft has disabled the built-in Indeo codecs due to 
    vulnerabilities.(Microsoft Security Advisory 954157) If you 
    enable them you are doing so on your own risk.
    `n" -BackgroundColor Red -ForegroundColor White
    
    # y/n Prompt:
    $confirmation = Read-Host "Continue? [y/n]"
    while ($confirmation -ne "y")
    {
        if ($confirmation -eq 'n') {exit}
        $confirmation = Read-Host "Continue? [y/n]"
    }
    
    # Get OS build number:
    #[int]$ver = (Get-CimInstance Win32_OperatingSystem).BuildNumber
    [int]$ver = [System.Environment]::OSVersion.Version.Build
    
    # Compare to minimum supported build number:
    if($ver -lt 9200)
    {
        Write-Host "build number: $ver"
        Write-Host "Needs Windows 8 (build number 9200) or newer to run."
        $confirmation = Read-Host "Press Enter to exit"
        exit
    }
    
    # Determine OS bits 64 or 32:
    if([Environment]::Is64BitOperatingSystem -like "True")
    {
        # Verify that indeo codec files exist:
        if (-Not (Test-Path -Path "$Env:windir\SysWOW64\ir50_32original.dll"))
        {
            Write-Host "ERROR! Proper Indeo codec file not found in system."
            $confirmation = Read-Host "Press Enter to exit"
            exit
        }
        # Set windir variable and trim it to just the drive letter:
        $_windir=$Env:windir -replace ":.*"
        # Set trademark symbol variable:
        $_tradmk=[char]0x00AE
        # Spitting out the reg files:
        Out-File -FilePath .\indeo_codecs_enable.reg
    
        'Windows Registry Editor Version 5.00' | Out-File -FilePath .\indeo_codecs_enable.reg
    
        '' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir32_32original.dll"="Intel Indeo(R) Video R3.2"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv32"="{0}:\\Windows\\system32\\ir32_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir41_32original.dll"="Intel Indeo{1} Video 4.5"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv41"="{0}:\\Windows\\system32\\ir41_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir50_32original.dll"="Indeo{1}-video 5.10"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv50"="{0}:\\Windows\\system32\\ir50_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\iac25_32.ax"="Indeo{1} audio software"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"msacm.iac2"="{0}:\\Windows\\system32\\iac25_32.ax"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
    
        Out-File -FilePath .\indeo_codecs_disable.reg
    
        'Windows Registry Editor Version 5.00' | Out-File -FilePath .\indeo_codecs_disable.reg
    
        '' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir32_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv32"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir41_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv41"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir50_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv50"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\iac25_32.ax"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"msacm.iac2"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
    }
    
    else # 32-bit OS (x86)
    {
        # Verify that indeo codec files exist:
        if (-Not (Test-Path -Path "$Env:windir\System32\ir50_32original.dll"))
        {
            Write-Host "ERROR! Proper Indeo codec file not found in system."
            $confirmation = Read-Host "Press Enter to exit"
            exit
        }
        # Set windir variable and trim it to just the drive letter:
        $_windir=$Env:windir -replace ":.*"
        # Set trademark symbol variable:
        $_tradmk=[char]0x00AE
        # Spitting out the reg files:
        Out-File -FilePath .\indeo_codecs_enable.reg
    
        'Windows Registry Editor Version 5.00' | Out-File -FilePath .\indeo_codecs_enable.reg
    
        '' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir32_32original.dll"="Intel Indeo(R) Video R3.2"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv32"="{0}:\\Windows\\system32\\ir32_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir41_32original.dll"="Intel Indeo{1} Video 4.5"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv41"="{0}:\\Windows\\system32\\ir41_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\ir50_32original.dll"="Indeo{1}-video 5.10"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"vidc.iv50"="{0}:\\Windows\\system32\\ir50_32original.dll"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"{0}:\\Windows\\system32\\iac25_32.ax"="Indeo{1} audio software"' -f $_windir, $_tradmk | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_enable.reg -Append
        '"msacm.iac2"="{0}:\\Windows\\system32\\iac25_32.ax"' -f $_windir | Out-File -FilePath .\indeo_codecs_enable.reg -Append
    
        Out-File -FilePath .\indeo_codecs_disable.reg
    
        'Windows Registry Editor Version 5.00' | Out-File -FilePath .\indeo_codecs_disable.reg
    
        '' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir32_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv32"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir41_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv41"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\ir50_32original.dll"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"vidc.iv50"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"{0}:\\Windows\\system32\\iac25_32.ax"=-' -f $_windir | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
        '"msacm.iac2"=-' | Out-File -FilePath .\indeo_codecs_disable.reg -Append
    }
    
    Write-Host "`n.reg files generated run them to enable or disable the Indeo codecs." -BackgroundColor Green -ForegroundColor Black
    [console]::beep(500,300) # Plays a beep sound.
    $confirmation = Read-Host "Press Enter to exit"
    exit
    

    For a version that works with the older (WinXP, Vista, Win7) versions of Windows see the post further down:
    https://sourceforge.net/p/dxwnd/discussion/general/thread/f77b08a057/#7dc5

     

    Last edit: dippy dipper 2023-06-11
  • dippy dipper

    dippy dipper - 2023-06-07

    Windows XP, Vista and 7 users are left out but if I remember correctly the old IndeoVideo installers still work with those older operating systems for enabling the codecs.

     
  • dippy dipper

    dippy dipper - 2023-06-07

    Updated the script by adding some logic to get the drive letter where Windows is installed when building the .reg files. It does look horribly messy and there might have been a simpler / better way to do it but it works...

     
  • gho

    gho - 2023-06-08

    Very good, but I made a newbie test (since I really am a newbie on powershell scripts) and got a bad result.
    I copied your script on a indeo.ps1 file, then tried to run it either by your suggested method (right-click, run with PowerShell) and from a command prompt (to get some output). Here the result:

    PS C:\Users\gho\Documents\DxWnd\v2_05_97_beta\build\indeo> .\indeo.ps1
    .\indeo.ps1 : Impossibile caricare il file C:\Users\gho\Documents\DxWnd\v2_05_97_beta\build\indeo\indeo.ps1.
    L'esecuzione di script è disabilitata nel sistema in uso. Per ulteriori informazioni, vedere about_Execution_Policies
    all'indirizzo https://go.microsoft.com/fwlink/?LinkID=135170.
    In riga:1 car:1
    + .\indeo.ps1
    + ~~~~~~~~~~~
        + CategoryInfo          : Errore di protezione: (:) [], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess
    PS C:\Users\gho\Documents\DxWnd\v2_05_97_beta\build\indeo>
    

    It seems that there's nothing wrong with the script, but there are protection issues that many generic users could have.

     

    Last edit: gho 2023-06-08
    • dippy dipper

      dippy dipper - 2023-06-10

      NOTE: Do not use the attached indeo.ps1 if your PowerShell version is not 5.0 or newer. Due to the lack of "-NoNewLine" command on older PS versions it will generate bad .reg files.

       
  • gho

    gho - 2023-06-08

    This could be the reason, from google frequent Q&A:

    Open the Privacy & Security tab in the left pane.
    Next, click on For developers.
    Click to expand the PowerShell section.
    Toggle the switch to change the execution policy to allow local PowerShell scripts to run without signing - Require signing for remote scripts.

    It's ok, but it seems more complex and more dangerous (if you forget to restore the previous settings) than picking the correct .reg script.
    On the overall, it reminds me what seems a general Microsoft policy: first struggle to make very powerful software, then struggle to make it hard to use because it's too dangerous.

     

    Last edit: gho 2023-06-08
    • dippy dipper

      dippy dipper - 2023-06-08

      That option appears to be enabled on my Win10 PC and I believe it was that way by default. Perhaps it is disabled by default on Windows 11?

      Also third party anti virus software could have changed that option.

      Edit:
      I don't think it is disabled by default unless something changed the setting after Windows installation. PowerShell scripts them self have additional permission requirements. For example if you try to do something "dangerous" it usually requires additional permissions to be granted. As an example I could not change registry settings from PowerShell, hence the need for generating the .reg files.

      One could add a readme note:

      If your privacy settings have been changed to disallow PowerShell scripts they can be enabled from Settings->Privacy & security->For developers->PowerShell (Turn on these settings to execute PowerShell scripts)

      Anyway it's your call of course.

       

      Last edit: dippy dipper 2023-06-08
  • huh

    huh - 2023-06-08

    If my notes are still valid in Win11, it says that some elevated permissions will be enforced with this parameter for a one-time run, but that's not suitable for a beginner, I think.

    powershell -ExecutionPolicy Unrestricted

     
    • dippy dipper

      dippy dipper - 2023-06-08

      I think "ExecutionPolicy Unrestricted" is not the same as having powershell scripts completely disabled as was on gho's computer.

      That execution policy change would mean the PowerShell script can do admin protected tasks like change registry keys. The script I wrote does not change any system settings only ask for OS version, and checks for existing files and OS bits. It changes nothing and thus does not require execution policy changes.

      The irony of it all is that you can still run the good old .reg files to mess up your system with nothing more than a simple "Are you sure" prompt. :-)

       

      Last edit: dippy dipper 2023-06-08
  • dippy dipper

    dippy dipper - 2023-06-08

    One trick I found that requires no changes to Windows settings is to run the script with this command from cmd prompt:
    powershell -noprofile -executionpolicy bypass -file .\indeo.ps1
    So this could be in a batch file "run-indeo.cmd".

    This command should allow the temporary execution of an unsigned PS script. It should not alter any execution policies permanently or require reboots, etc.

     

    Last edit: dippy dipper 2023-06-08
  • dippy dipper

    dippy dipper - 2023-06-08

    (Get-CimInstance Win32_OperatingSystem).BuildNumber was a bit overkill and not compatible with older PowerShell versions so changed it to: [System.Environment]::OSVersion.Version.Build.

     
  • dippy dipper

    dippy dipper - 2023-06-08

    OK, I think I am done with this project. I am attaching here a possible release candidate version which includes the actual PS script, the cmd batch file to run it and a readme.txt.

    EDIT: Attachment deleted.

     

    Last edit: dippy dipper 2023-06-10
  • gho

    gho - 2023-06-08

    It seems to work very well here on Win11.
    If things were harder than expected, I thought that maybe I could replicate the script logic programmatically within the DxWnd GUI, but I see that this works fine, so for me it's good as it is.
    I will add this line to my kit generation script to avoid the risk of inadvertently shipping the DxWnd bundle with pre-cooked .reg files good only for my computer.

    del /Q build\indeo\*.reg
    
     

    Last edit: gho 2023-06-08
  • BEEN_Nath_58

    BEEN_Nath_58 - 2023-06-08

    Just from. the perspective of compatibility, why was PowerShell used?

    Wasn't CMD + regedit enough?

     
  • dippy dipper

    dippy dipper - 2023-06-08

    I guess it could all have been done also with a cmd batch file. Originally I chose PowerShell because I thought it was the more modern solution providing a wider range of options.

    For example some of the equivalent cmd prompt commands that could be used:

    ::Get Windows version
    ver

    ::Get OS bits 32/64
    wmic os get osarchitecture
    (Problem with WinXP as it does not support the "osarchitecture" command. Then again 64bit WinXP was rarely used.)

    ::Find out if proper indeo codec file exists
    if exist "path\file"

    ::Get Windows directory
    wmic os get windowsdirectory

    And of course variables need to be used and trimmed, copied, etc.

    However for now the PowerShell script should suffice as we are only supporting Win8-11 with it and PowerShell comes with those operating systems pre-installed.

    P.S.
    With a cmd batch file I believe you can also use the command: reg import file.reg to install registry entries without a problem. This is normally not allowed with PowerShell without extra permissions. (admin rights are not enough)

    So with a cmd batch file you could probably create the .reg file install it from withing the batch and then immediately delete it. Crazy...

    P.P.S.
    So Microsoft built lots of protection in PowerShell only to allow the old and insecure CMD commands to work beside it and even overwrite it (see: powershell -noprofile -executionpolicy bypass -file .\indeo.ps1). :-D

     

    Last edit: dippy dipper 2023-06-08
  • dippy dipper

    dippy dipper - 2023-06-08

    EDIT:
    Well... You can disregard this post. It is silly...

    Ouch... I forgot how painful working with variables and trimming them can be in the cmd prompt...

    An example to get the Windows version information and trimming the build number to store in a variable:

    @echo off
    setlocal enableextensions
    
    :: Get Windows version and trim it until we are left with just the build number:
    for /f "tokens=*" %%a in (
    'VER'
    ) do (
    set _tmp1=%%a
    )
    SET _tmp2=%_tmp1:*.=%
    SET _tmp3=%_tmp2:*.=%
    SET _tmp4=%_tmp3:*.=%
    CALL SET _tmp5=%%_tmp3:%_tmp4%=%%
    SET _winver=%_tmp5:.=%
    echo %_winver%
    
    pause
    endlocal
    

    Where as with PowerShell I could just use this:

    [int]$ver = [System.Environment]::OSVersion.Version.Build
    $ver
    

    Not to mention that horrible cmd method would only work on Windows 10 for getting the build number. Windows XP has less numeric values in its ver string separated by dots. So one would need to make the logic even more complex to take that into account. Then I also remembered the jungle of GOTO statements and all the fun commands used in CMD prompt going back to the 80's and the days of MS BASIC...

    It was an interesting experiment but I think I will leave the cmd batch building to someone more experienced (and someone with more patience).

     

    Last edit: dippy dipper 2023-06-08
  • dippy dipper

    dippy dipper - 2023-06-08

    Well turns out it wasn't quite so difficult after all. The following is a cmd prompt or batch file version.

    Main differences to the PowerShell version are that it does the registry import without needing to run the .reg files manually. And since it is just a batch file it would run even on a system without PowerShell installed (WinXP and Vista by default did not come with PowerShell).

    Update:
    The cmd version is now re-written for use with "legacy" Windows versions only. So it will check that is running on WinXP, Vista or Win7 and abort otherwise.

    @echo off
    
    ::Obtain admin rights if system is newer than WinXP
    ver | find "6" > nul
    if %ERRORLEVEL% == 1 goto WinXP
    
    rem ----------------- obtain admin start -----------------
    :obtain_admin
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    if '%errorlevel%' NEQ '0' goto UACPrompt
    goto gotAdmin
    
    :UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs" && exit /B
    
    :gotAdmin
    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%" && CD /D "%~dp0"
    rem ----------------- obtain admin end -----------------
    
    :WinXP
    
    echo Indeo codec enabler/disabler cmd batch for WinXP, Vista and Win7
    echo -----------------------------------------------------------------
    echo This batch file will generate .reg files and import them to the 
    echo system registry to enable or disable the Indeo codecs for WinXP,
    echo Vista and Win7 systems. (Note: WinXP needs at least Service Pack 2)
    echo(
    echo The codecs are:
    echo - Intel Indeo(R) Video R3.2
    echo - Intel Indeo(R) Video 4.5
    echo - Indeo(R)-video 5.10
    echo - Indeo(R) audio software
    echo(
    echo Disclaimer: Microsoft has disabled the built-in Indeo codecs due to 
    echo vulnerabilities.(Microsoft Security Advisory 954157) If you 
    echo enable them you are doing so on your own risk.
    echo(
    
    :PROMPT1
    set /p yesno=Continue (Y/N)?
    if /i "%yesno%" NEQ "Y" GOTO EOF
    
    echo Initial cleanup...
    del indeo_codecs_enable.reg
    del indeo_codecs_disable.reg
    echo(
    
    set Version=
    for /f "skip=1" %%v in ('wmic os get version') do if not defined Version set Version=%%v
    for /f "delims=. tokens=1-3" %%a in ("%Version%") do (
      set Version.Build=%%c
    )
    :: Windows version numbers 2600=XP, 3790=XP-64bit, 6002=Vista, 7601=Win7
    if %Version.Build% == 2600 (GOTO LEGACYWIN)
    if %Version.Build% == 3790 (GOTO LEGACYWIN)
    if %Version.Build% == 6002 (GOTO LEGACYWIN)
    if %Version.Build% == 7601 (GOTO LEGACYWIN)
    if %Version.Build% GEQ 9200 (GOTO WIN8)
    echo Windows Build %Version.Build% is too old (not supported). Exiting...
    pause
    exit
    
    :WIN8
    echo Windows Build %Version.Build% is newer than Win7 (not supported). Exiting...
    pause
    exit
    
    :LEGACYWIN
    echo Supported Windows Build %Version.Build% detected.
    echo Note: To abort at this stage just close the cmd prompt window.
    if exist %windir%\syswow64 (GOTO 64BIT) ELSE (GOTO 32BIT)
    :64BIT
    if exist %windir%\syswow64\ir50_32.dll (GOTO CONT) ELSE (GOTO ABORT)
    :CONT
    ::Start writing the first .reg file
    set _tmp=%windir%
    set _windir=%_tmp:\=\\%
    echo Windows Registry Editor Version 5.00 >> indeo_codecs_enable.reg
    echo( >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir32_32.dll"="Intel Indeo(R) Video R3.2" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv32"="%_windir%\\system32\\ir32_32.dll" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir41_32.ax"="Intel Indeo® Video 4.5" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv41"="%_windir%\\system32\\ir41_32.ax" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir50_32.dll"="Indeo®-video 5.10" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv50"="%_windir%\\system32\\ir50_32.dll" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\iac25_32.ax"="Indeo® audio software" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "msacm.iac2"="%_windir%\\system32\\iac25_32.ax" >> indeo_codecs_enable.reg
    ::The second .reg file
    echo Windows Registry Editor Version 5.00 >> indeo_codecs_disable.reg
    echo( >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir32_32.dll"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv32"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir41_32.ax"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv41"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir50_32.dll"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv50"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\iac25_32.ax"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "msacm.iac2"=- >> indeo_codecs_disable.reg
    
    :PROMPT2
    set /p question=Do you want to (E)nable or (D)isable the Indeo codecs?
    if /i "%question%" NEQ "E" GOTO ENABLE1
    cls
    reg import indeo_codecs_enable.reg
    echo Enabled Indeo codecs in registry...
    del indeo_codecs_enable.reg
    del indeo_codecs_disable.reg
    pause
    exit
    
    :ENABLE1
    cls
    reg import indeo_codecs_disable.reg
    echo Disabled Indeo codecs in registry...
    del indeo_codecs_disable.reg
    del indeo_codecs_enable.reg
    pause
    exit
    
    :32BIT
    if exist %windir%\system32\ir50_32.dll (GOTO CONT2) ELSE (GOTO ABORT)
    :CONT2
    ::Start writing the first .reg file
    set _tmp=%windir%
    set _windir=%_tmp:\=\\%
    echo Windows Registry Editor Version 5.00 >> indeo_codecs_enable.reg
    echo( >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir32_32.dll"="Intel Indeo(R) Video R3.2" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv32"="%_windir%\\system32\\ir32_32.dll" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir41_32.ax"="Intel Indeo® Video 4.5" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv41"="%_windir%\\system32\\ir41_32.ax" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\ir50_32.dll"="Indeo®-video 5.10" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "vidc.iv50"="%_windir%\\system32\\ir50_32.dll" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_enable.reg
    echo "%_windir%\\system32\\iac25_32.ax"="Indeo® audio software" >> indeo_codecs_enable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_enable.reg
    echo "msacm.iac2"="%_windir%\\system32\\iac25_32.ax" >> indeo_codecs_enable.reg
    ::The second .reg file
    echo Windows Registry Editor Version 5.00 >> indeo_codecs_disable.reg
    echo( >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir32_32.dll"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv32"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir41_32.ax"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv41"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\ir50_32.dll"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "vidc.iv50"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc] >> indeo_codecs_disable.reg
    echo "%_windir%\\system32\\iac25_32.ax"=- >> indeo_codecs_disable.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32] >> indeo_codecs_disable.reg
    echo "msacm.iac2"=- >> indeo_codecs_disable.reg
    
    :PROMPT3
    set /p question=Do you want to (E)nable or (D)isable the Indeo codecs?
    if /i "%question%" NEQ "E" GOTO ENABLE2
    cls
    reg import indeo_codecs_enable.reg
    echo Enabled Indeo codecs in registry...
    del indeo_codecs_enable.reg
    del indeo_codecs_disable.reg
    pause
    exit
    
    :ENABLE2
    cls
    reg import indeo_codecs_disable.reg
    echo Disabled Indeo codecs in registry...
    del indeo_codecs_disable.reg
    del indeo_codecs_enable.reg
    pause
    exit
    
    :ABORT
    echo ERROR! Proper Indeo codec file not found in system. Aborting...
    pause
    exit
    
    :EOF
    exit
    
     

    Last edit: dippy dipper 2023-06-11
  • dippy dipper

    dippy dipper - 2023-06-09

    Regarding Indeo video on older Windows versions at least on WinXP (SP3) I could enable IV50 support by simply running the command "regsvr32 ir50_32.dll". In addition it looks like ir32_32.dll for IV32 was enabled already but if its not then simply using regsvr32 on it probably is enough. Perhaps it is the same for Vista and Win7 in which case there is really no need to add them in the script.

    So as there likely is no need for backwards compatibility I would recommend sticking with the PowerShell script.

     
  • dippy dipper

    dippy dipper - 2023-06-09

    Disregard this post.

    For those Windows operating systems older than Win8 the instruction could be this one:
    -removed-

     

    Last edit: dippy dipper 2023-06-10
  • BEEN_Nath_58

    BEEN_Nath_58 - 2023-06-09

    hmm I will need to install WIn7 new today, so I might well test. Is there any specific, direct procedure that can verify the existence of Indeo ?

     
  • gho

    gho - 2023-06-09

    Uhmm... on old machines, if the indeo codecs are not installed and need regsvr32.exe to make the component registration, I suppose that the dlls could be missing. In that case, shouldn't we provide also the files and some direction about where to copy them? Just a doubt ....

     
  • huh

    huh - 2023-06-09

    @BEEN_Nath_58
    You can use my procedure here
    https://sourceforge.net/p/dxwnd/discussion/general/thread/f77b08a057/#14f1

    Update:
    I have added the player to the attachment.

     

    Last edit: huh 2023-06-09
  • dippy dipper

    dippy dipper - 2023-06-09

    I had an installation of Windows XP SP3 on VirtualBox to test with. The codec files were already in the System32 directory. I will need to do a fresh installation to verify it 100% but I believe the files came bundled with WinXP or one of the service packs. From Win7 days I also seem to recall the codecs come with the Windows installation but are simply not "enabled" by default. So there should be no need to provide any files.

    You can verify the presence of Indeo codec files by looking in the windows\system32 (windows\SysWOW64 if 64bit) folder for the following files:
    ir32_32.dll
    ir41_32.ax
    ir50_32.dll

    So if my theory is right on WinXP, Vista and Win7 to enable the built-in codecs you simply need to use the regsvr32 command for the codecs files.

    For Win8, 10 and 11 you need the registry change instead.

     

    Last edit: dippy dipper 2023-06-09
  • BEEN_Nath_58

    BEEN_Nath_58 - 2023-06-09

    I haven't been able to install Win7 yet due to some other issues, but I also got this.

    http://forum.videohelp.com/threads/266794-Indeo-5-x-problem-with-Vista?p=1660521&viewfull=1#post1660521

    iirc I only had to use regsvr on win7. But I will verify it again. I will also need to instal Winxp too so I. will test there as well

     

    Last edit: BEEN_Nath_58 2023-06-09
1 2 3 > >> (Page 1 of 3)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.