REM *** First - A big thank you to Microsoft for including a free WTV converter REM *** Without this converter my Media Center would have stayed a Vista PC for years REM *** Thanks to LifeExtender - Who can now release a new version that incorporates WTVConverter :) REM *** Oringal WTV Files Retention (see DAYS2KEEP) - Just in case (Critial Feature) REM *** Best viewed in Notepad ++ (http://notepad-plus.sourceforge.net) REM *** Writen by ToeKneeC REM *** Upated 05-30-2009 REM *** Version 1.1 REM **************************************************************** @ECHO OFF TITLE Tony's Automated WTVconverter Script Color 0A CLS ::Declare Variables ::Make sure there are NO spaces before and after the = sign (and NO quotes) ::Only modify DAYS2KEEP, RECORDEDTVPATH, HD4CONVERSION if needed. REm ******************************************************************************************* ::How long do you want to keep the orignal WTV files - The higher the #, the more HD room needed SET DAYS2KEEP=2 REm ******************************************************************************************* ::Path to Record TV - Pulled from the registry. FOR /F "skip=1 tokens=2*" %%I IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Service\Recording" /V "RecordPath"') DO @SET TMP=%%J SET RECORDEDTVPATH=%TMP% ::Hard Drive Letter where conversion folder should be used (Default is the same HD as Recorded TV) SET HD4CONVERSION=%RECORDEDTVPATH:~0,1% ::Complete Path To Conversion Folder (Don't Change) SET TV2CONVERTPATH=%HD4CONVERSION%:\TV2Convert GOTO VERIFYSTUFF :VERIFYSTUFF REM *** Verify Recorded TV and Conversion Folder Path are correct. REM *** Verify the PC has the WTVconverter. If NOT EXIST "%RECORDEDTVPATH%" GOTO WRONGTVPATH If NOT EXIST "%TV2CONVERTPATH%" GOTO MAKEFOLDERS IF NOT EXIST %WINDIR%\ehome\WTVconverter.exe ECHO Your version of Windows doesn't have the WTVconverter Program - Must End.&PAUSE>NUL&GOTO END GOTO MOVEWTVFILES :MOVEWTVFILES REM *** Move .WTV files from the default Recorded TV folder to the Conversion folder MOVE "%RECORDEDTVPATH%\*.wtv" "%TV2CONVERTPATH%" GOTO STARTCONVERSION :STARTCONVERSION REM *** Start Conversions from .wtv to .dvr-ms %WINDIR%\ehome\WTVconverter.exe "%TV2CONVERTPATH%\*.wtv" GOTO MOVEDVRMSFILES :MOVEDVRMSFILES REM *** Move New .dvr-ms Files Back to Recorded TV Location REM *** This is so that 3rd party programs that monitor the Recorded TV folder just work with their defaults MOVE "%TV2CONVERTPATH%\*.dvr-ms" "%RECORDEDTVPATH%\" GOTO MOVEORGFILES :MOVEORGFILES REM *** Moves Original, Untouched .WTV Files to a safe location (Just In Case) MOVE "%TV2CONVERTPATH%\*.wtv" "%TV2CONVERTPATH%\ORIGINAL-FILES" GOTO DELETEOLD :DELETEOLD REM *** Deletes Original Older WTV FILES no longer needed based on your Days2Keep setting ROBOCOPY %TV2CONVERTPATH%\ORIGINAL-FILES\ %TV2CONVERTPATH%\FILES2DEL\ /MOV /MINAGE:%DAYS2KEEP% DEL "%TV2CONVERTPATH%\FILES2DEL\*.wtv" /Q GOTO END :WRONGTVPATH :: Notify End User the Recorded TV Path is incorrect Color 0E ECHO. ECHO Path you defined %RECORDEDTVPATH% ECHO. ECHO This path doesn't exist for your Recorded TV location. ECHO. ECHO Make sure you have no spaces before or after the equal sign. ECHO. ECHO Make sure you did NOT use quotes. ECHO. ECHO YOU MUST FIX THIS BEFORE THIS PROGRAM CAN WORK ECHO. PAUSE GOTO END :MAKEFOLDERS :: Creating Folder Stucture ECHO Creating TV2CONVERT Folder Structure MD "%TV2CONVERTPATH%" MD "%TV2CONVERTPATH%\ORIGINAL-FILES" MD "%TV2CONVERTPATH%\FILES2DEL" If NOT EXIST "%TV2CONVERTPATH%" ECHO. COULD NOT CREATE FOLDER STUCTURE FOR WORK DIRECTORY %TV2CONVERTPATH%.&PAUSE>NUL&GOTO END GOTO VERIFYSTUFF :END ECHO. ECHO.