Issue running CLI batch file via windows task scheduler

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Andishi
Posts: 2
Joined: 18 Oct 2014, 05:26

Issue running CLI batch file via windows task scheduler

Post by Andishi »

Having a minor issue here that I can't seem to make sense of/work out, so here it goes...

I am currently recording live TV via cable card through Windows Media Center. Unfortunately Plex does not play nice with its default naming convention which is where FileBot comes in and works its magic.

The issue here is that in trying to automate the process I have created a batch file which runs when a recording finishes up and first moves it onto my network storage, and then calls FileBot from the CLI to rename the file, below is the contents of my batch.

@ECHO OFF
move "C:\Users\Public\Recorded TV\*.wtv" "\\Matt-PC\d$\Hyper-V\Virtual Transfer\Tv Media\Recordings"

sleep 30
cd C:\Program Files\FileBot
filebot -rename "\\Matt-PC\d$\Hyper-V\Virtual Transfer\TV Media\Recordings" --db thetvdb --format "{n}/{'Season '+s}/{n} - {s00e00} - {t}" -non-strict

The thing that has me stuck right now is that the batch works just fine if I manually click and run it, but any time it runs via the scheduler either with a forced run or when it is supposed to run it will complete the move but the filebot portion will seemingly not run.

Thinking that this may be a permissions issue with task scheduler with it not inheriting proper permissions I went ahead and granted full access on every single file/folder involved to the account which is running the task and still nothing... I have been banging my head and am getting nowhere at this point, any help or insight that you may offer would be greatly appreciated. Thanks in advance!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Issue running CLI batch file via windows task scheduler

Post by rednoah »

Spaces will fuck you if you don't always escape things properly:

Code: Select all

cd "C:\Program Files\FileBot"
As for the filebot call I'd add --log-file "C:/rename.log" so you see what's going on, and if filebot is called at all. Along those lines, I'd make sure you redirect the output of your whole script to a file so you can see what it's doing or not doing.
:idea: Please read the FAQ and How to Request Help.
Andishi
Posts: 2
Joined: 18 Oct 2014, 05:26

Re: Issue running CLI batch file via windows task scheduler

Post by Andishi »

Yup, quotes that did it.... knew it was something silly/obvious but couldn't place it. Thanks a ton!
Post Reply