NextPVR Forums

Full Version: Imagegrablite .nfo cleanup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been trying to write a batch file that could run on my NPVR PC to cleanup .nfo files for shows that have been deleted from within XBMC. So far I have not had any luck. I would like to delete .nfo files for the deleted episodes and not the tvshow.nfo files. Anyone got some clever batch file writing skills that cares to help? Or is there a tool already for this that I am unaware of?
This should help get you going
Code:
@echo off
for /r %%G in ("*.nfo") do (call :check "%%G")
goto :eof
:check
if "%~nx1"="tvshow.nfo" goto :eof
if exist %~pn1.ts goto :eof
@echo %~f1
:eof

Martiin
Thanks. I'll try to look into more this week when I get another free moment.
With that nudge I got to this:
Code:
@echo off
for /r %%G in ("*.nfo") do (call :check "%%G")
goto :eof

:check
if "%~nx1"=="tvshow.nfo" goto :eof
if exist "%~pn1.ts" goto :eof
echo "%~pnx1"
del "%~pnx1"

:eof
It works well.