Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: For use with updated measures, checks task scheduler instead of Bat files (as method has changed)
- :: Removes Old Tasks, to keep scheduler clean (requires VLC to be finished, which prevents accidental ending of recording)
- @echo off
- set HB="C:\Program Files\HandBrake\handbrakecli"
- set PRE=--preset-import-gui --preset
- set PRVH=LibupVHS
- set PRTS=LibupTVS
- set INVH=Z:Z:\VHS\
- set INVH2=Z:\VHS-Extras\
- set INVH3=Z:\Videos\VHS\
- set INTS=Z:\Videos\TVShowwAdsTS\
- set INVS=Z:\Videos\TVMovieswAds\
- set FTP=Z:\Videos\Hold\
- set FTPH=Z:\Videos\Hold\Listed\
- set TSCK=0
- set TSM=0
- set F=*.ts
- if EXIST %INVS%%F% ( goto TSKCHV ) else ( goto TSKCHVE )
- :TSKCHV
- move %INVS%%F% %FTP%%F%
- for %%a in (%FTP%%F%) do (
- Schtasks /query /tn %%~na >NUL 2>&1
- if %errorlevel% EQU 0 ( schtasks /delete /tn "%%~na" )
- )
- move %FTP%%F% %INVS%%F%
- :TSKCHVE
- if EXIST %INTS%%F% ( goto TSKCHT ) else ( goto TSKCHTE )
- :TSKCHT
- move %INTS%%F% %FTP%%F%
- for %%a in (%FTP%%F%) do (
- Schtasks /query /tn %%~na >NUL 2>&1
- if %errorlevel% EQU 0 ( schtasks /delete /tn "%%~na" )
- )
- move %FTP%%F% %INTS%%F%
- :TSKCHTE
- echo echo off > temp.bat
- attrib +h temp.bat
- echo echo Files Started Converting to h265 on %date% ^> Completed.txt >> temp.bat
- echo attrib +h Completed.txt >> temp.bat
- echo echo -- ^> Transcoding-In-Progress >> temp.bat
- echo echo call Completed.txt ^> Check-Progress.bat >> temp.bat
- set TSM=0
- if EXIST %INVH%*.mov goto VHSST
- goto VHSSK
- :VHSST
- move "%INVH%*.mov" %FTP%
- goto VHSEP
- :VHS2
- set TSM=1
- if EXIST "%INVH2%*.mov" goto VHSST2
- goto VHSSK
- :VHSST2
- move %INVH2%*.mov %FTP%
- goto VHSEP
- :VHS3
- set TSM=2
- if EXIST "%INVH3%*.mov" goto VHSST3
- goto VHSSK
- :VHSST3
- move %INVH3%*.mov %FTP%
- goto VHSEP
- :: Room for more VHS folders based on storage orginization
- :VHSEP
- for %%a in (%FTP%*.mov) do (
- if %TSM% EQU 0 (echo move %INVH%%%~na.mov %FTP% >> temp.bat)
- if %TSM% EQU 1 (echo move %INVH2%%%~na.mov %FTP% >> temp.bat)
- if %TSM% EQU 2 (echo move %INVH3%%%~na.mov %FTP% >> temp.bat)
- if %TSM% EQU 0 (echo %HB% -i %%a -o %INVH%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
- if %TSM% EQU 1 (echo %HB% -i %%a -o %INVH2%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
- if %TSM% EQU 2 (echo %HB% -i %%a -o %INVH3%%%~na.mp4 %PRE% "%PRVH%" >> temp.bat)
- echo echo %%~na.mp4 ^>^> Completed.txt >> temp.bat
- echo del %%a >> temp.bat
- if %TSM% EQU 0 (move %%a %INVH%)
- if %TSM% EQU 1 (move %%a %INVH2%)
- if %TSM% EQU 2 (move %%a %INVH3%)
- )
- :VHSSK
- if %TSM% EQU 0 goto VHS2
- if %TSM% EQU 1 goto VHS3
- set TSM=0
- if EXIST %INTS%*.ts goto TVSST
- goto TVSSK
- :TVSST
- move %INTS%*.ts %FTP%
- goto TSLP
- :TVSSK
- set TSM=1
- if EXIST %INVS%*.ts goto TMSST
- goto TSSK
- :TMSST
- move %INVS%*.ts %FTP%
- goto TSLP
- :TSLP
- for %%a in (%FTP%*.ts) do (
- if %TSM% EQU 0 (echo move %INTS%%%~na.ts %FTP% >> temp.bat)
- if %TSM% EQU 1 (echo move %INVS%%%~na.ts %FTP% >> temp.bat)
- if %TSM% EQU 0 (echo %HB% -i %%a -o %INTS%%%~na.mp4 %PRE% "%PRTS%" >> temp.bat)
- if %TSM% EQU 1 (echo %HB% -i %%a -o %INVS%%%~na.mp4 %PRE% "%PRTS%" >> temp.bat)
- echo echo %%~na.mp4 ^>^> Completed.txt >> temp.bat
- echo del %%a >> temp.bat
- if %TSM% EQU 0 (move %%a %INTS%)
- if %TSM% EQU 1 (move %%a %INVS%)
- )
- :TSSK
- if %TSM% EQU 0 goto TVSSK
- echo del Transcoding-In-Progress >> temp.bat
- echo echo Finished ^>^> Completed.txt >> temp.bat
- echo attrib -h Completed.txt >> temp.bat
- echo start Check-Progress.bat >> temp.bat
- echo del Check-Progress.bat >> temp.bat
- echo attrib -h temp.bat >> temp.bat
- echo del temp.bat >> temp.bat
- start quiet temp.bat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement