Sunday, December 19, 2010

Symbolic Link Batch File

Dear Blog,

I use Boxee, and when I download DVDs, they don't show up as episodes on my TV Guide. Someone suggested making symbolic links... Sounds good to me. Here's a batch file I use to generate these symbolic links (not catching me renaming 100's of files

@echo off
SETLOCAL EnableDelayedExpansion
echo -------------------------------------------------------------------------
echo  This will make symbolic links for your ISO/IMG files
echo -------------------------------------------------------------------------
echo.

IF "%~f1" == "" (
  echo No file dragged onto this script
  pause
  EXIT
)

SET /P season=Season (ie 1)? 
SET /P episodeStart=Starting Episode (ie 1)? 
SET /P episodeEnd=Ending Episode (ie 4)?

IF NOT DEFINED season SET season=1
IF NOT DEFINED episodeStart SET episodeStart=1
IF NOT DEFINED episodeEnd SET episodeEnd=4

IF %season% LSS 10 SET season=0%season%
IF %episodeStart% LSS 10 SET episodeStartZero=0%episodeStart%

SET firstEpisode=%~n1 S%season%E%episodeStartZero%%~x1
MOVE "%~dpf1" "%~dp1%firstEpisode%"

IF %episodeStart% GEQ %episodeEnd% EXIT
SET /A episodeStart=episodeStart + 1

FOR /l %%n IN (%episodeStart%,1,%episodeEnd%) DO (
  SET currentEpisode=%%n
  IF !currentEpisode! LSS 10 SET currentEpisode=0!currentEpisode!
  mklink "%~dpn1 S%season%E!currentEpisode!%~x1" "%firstEpisode%"
)
pause

Edit: Hmm, my sickbeard renames the files, so here is my newer method... I append each dvd with their first episode, like first dvd would now end in s01e01. Do that for each dvd. Then sickbeard renames it. To show up nicely in boxee, I run the following, slighltly modified script:

@echo off
SETLOCAL EnableDelayedExpansion
echo -------------------------------------------------------------------------
echo  This will make symbolic links for your ISO/IMG files
echo -------------------------------------------------------------------------
echo.

IF "%~f1" == "" (
  echo No file dragged onto this script
  pause
  EXIT
)

SET /P season=Season (ie 1)? 
SET /P episodeStart=Starting Episode (ie 2)? 
SET /P episodeEnd=Ending Episode (ie 4)?

IF NOT DEFINED season SET season=1
IF NOT DEFINED episodeStart SET episodeStart=2
IF NOT DEFINED episodeEnd SET episodeEnd=4

IF %season% LSS 10 SET season=0%season%

FOR /l %%n IN (%episodeStart%,1,%episodeEnd%) DO (
  SET currentEpisode=%%n
  IF !currentEpisode! LSS 10 SET currentEpisode=0!currentEpisode!
  mklink "%~dp1S%season%E!currentEpisode!%~x1" "%~f1"
)
pause

Thursday, December 16, 2010

Enable Sound Controls (Mute) in Media Center 7 (7MC)

Dear Blog

Tonight I was having issues muting my HD content. My normal SD conent has normal, vol up/down and mute capabilities. Unfortunately, my HD conent was always like near max blast, even if I hit mute or vol down.

So what I did was turn on Auto Volume! It works now... no dolby digital sound from the TV anymore, but, I only use TV speakers anyway, so I'm not missing much.

I believe it's in:
Settings > TV > Audio > Auto Volume Checkbox

- ETdoFresh

Tuesday, December 7, 2010

Merge PDFs using Ghost Script (CutePDF)

Dear Blog,

Here is a batch file (.cmd or .bat) to merge PDFs

@echo off
echo -------------------------------------------------------------------------
echo  This will merge all your pdfs in the current directory to an output.pdf
echo -------------------------------------------------------------------------
echo.
Setlocal EnableDelayedExpansion
%~d0
cd %~p0
set /p MERGEFILE=Output file (no need to add .pdf)? 
set PDFMERGE=
for %%f in (*.pdf) do set PDFMERGE=!PDFMERGE! "%%f"
"C:\Program Files\GPLGS\gswin32c" -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile="%MERGEFILE%.pdf" %PDFMERGE%
pause