Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- REM Demo-script as asked on http://www.reddit.com/r/usenet/comments/2e47km/nzbget_script_help/
- goto start
- ###########################################################
- ### NZBGET POST-PROCESSING SCRIPT
- # Move files to another directory.
- #
- # NOTE: The script doesn't have a proper error handling. If the
- # destination directory contains files with the same names the new
- # files are not copied but silently deleted.
- ###########################################################
- ### OPTIONS
- # Final destination directory.
- #
- # Directory to move downloaded files to.
- #FinalDir=C:\Downloads\Final
- ### NZBGET POST-PROCESSING SCRIPT
- ###########################################################
- :start
- REM Error codes used by NZBGet
- SET POSTPROCESS_SUCCESS=93
- SET POSTPROCESS_NONE=95
- SET POSTPROCESS_ERROR=94
- echo [DETAIL] Script started
- REM Don't move files for failed downloads
- if "%NZBPP_TOTALSTATUS%" NEQ "SUCCESS" (
- echo [INFO] Download has failure status, don't moving any files
- exit /b %POSTPROCESS_NONE%
- )
- if "%NZBPO_FINALDIR%" EQU "" (
- echo [ERROR] Please set option FinalDir in the script settings
- exit /b %POSTPROCESS_ERROR%
- )
- echo [DETAIL] Moving files
- move %NZBPP_DIRECTORY%\* %NZBPO_FINALDIR%
- echo [DETAIL] Deleting old directory (should be empty but who knows?)
- rmdir /q %NZBPP_DIRECTORY%
- REM Let NZBGet know where the files were moved (this path is shown in history details dialog)
- echo [NZB] FINALDIR=%NZBPO_FINALDIR%
- exit /b %POSTPROCESS_SUCCESS%
Add Comment
Please, Sign In to add comment