Batch Scripting: Parameters passes on cmd path?

Support for Windows users
Post Reply
Chiller
Posts: 3
Joined: 12 Feb 2016, 08:55

Batch Scripting: Parameters passes on cmd path?

Post by Chiller »

Hello

First of all, Filebot is a amazing piece of software. :mrgreen:

I got filebot working straight from the start by using the finished AMC code. Then i wanted to hide those CMD-pop-ups when torrents finished downloading because it's quite annoying when playing games :)

So i went on to try to do a batch script but I'm having huge problems with the parameters passing on the Windows Command Prompt Path??

So this is the command i used in uTorrent before I went on to batch scripting, it works just fine!

Code: Select all

filebot -script fn:amc --output "H:/Movies & TV Save/Torrent" --action copy --conflict skip -non-strict --log-file amc.log --def "movieFormat=H:/Movies & TV Save/Torrent/Movies/{file.parentFile.name}/{fn}" --def subtitles=sv,en --def clean=y --def unsorted=y music=y artwork=n "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
My Batch Script

uTorrent program run command

Code: Select all

"C:\filebot_utorrent.bat" "%S" "%N" "%K" "%F" "%D" "%L"
Batch script

Code: Select all

rem Define variables
set ut_state=%1
set ut_title=%2
set ut_kind=%3
set ut_file=%4
set ut_dir=%5
set ut_label=%6

"C:\Program Files\FileBot\filebot.exe" -script fn:amc --output "H:/Movies & TV Save/Torrent" --action copy --conflict skip -non-strict --log-file amc.log --def "movieFormat=H:/Movies & TV Save/Torrent/Movies/{file.parentFile.name}/{fn}" --def subtitles=sv,en --def clean=y --def unsorted=y music=y artwork=n %ut_label% %ut_state% %ut_title% %ut_kind% %ut_file% %ut_dir%
This is the AMC log

Code: Select all

Run script [fn:amc] at [Fri Feb 12 09:53:43 CET 2016]
Parameter: movieFormat = H:/Movies & TV Save/Torrent/Movies/{file.parentFile.name}/{fn}
Parameter: subtitles = sv,en
Parameter: clean = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = n
Argument: C:\Windows\System32
Argument: C:\Windows\System32\5
Argument: C:\Windows\System32\Those.Who.Cant.S01E01.HDTV.x264-TASTETV
Argument: C:\Windows\System32\multi
Argument: C:\Windows\System32\Sample\those.who.cant.s01e01.hdtv.x264-tastetv.sample.mp4
Argument: F:\TV Shows\Those Who Cant\Those.Who.Cant.S01E01.HDTV.x264-TASTETV
File not found: C:\Windows\System32\5
Failure (°_°)
I'm on Windows 10.

Why does it include this "C:\Windows\System32" path on every parameter? I can't for the love of god find any reason to it. Been searching this forum for hours without any luck.

Any kind of help would be mutch appreciated!

Best Regards
Chiller
User avatar
rednoah
The Source
Posts: 23924
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Scripting: Parameters passes on cmd path?

Post by rednoah »

What does making a bat script have to do with not showing a console window?

filebot.exe is a console application executable, so windows will show a console. If you don't want a console then you can just use filebot.launcher.exe which is a gui application executable and won't show a console.
:idea: Please read the FAQ and How to Request Help.
Chiller
Posts: 3
Joined: 12 Feb 2016, 08:55

Re: Batch Scripting: Parameters passes on cmd path?

Post by Chiller »

rednoah wrote:What does making a bat script have to do with not showing a console window?

filebot.exe is a console application executable, so windows will show a console. If you don't want a console then you can just use filebot.launcher.exe which is a gui application executable and won't show a console.
I don't mind the console but i want to run filebot silently so I was going to do a batch script and get it working and then install NirCmd http://www.nirsoft.net/utils/nircmd.html and then run the command (NirCMD exec hide "C:\filebot_utorrent.bat" "%S" "%N" "%K" "%F" "%D" "%L") but I cannot understand whats wrong.

But i have not moved on to NirCmd yet because i need the batch script to work :/

Am I totally out in the woods? :)

Best Regards
Chiller
Posts: 3
Joined: 12 Feb 2016, 08:55

Re: Batch Scripting: Parameters passes on cmd path?

Post by Chiller »

Hello

I just did a parameter debug/test which i found on this website.

uTorrent Command

Code: Select all

"C:\filebot_test.bat" "%S" "%N" "%K" "%F" "%D"
Batch file

Code: Select all

filebot -script fn:sysenv %1 %2 %3 %4 %5

pause
Result
Image

It looks good here but I dont know why it adds that path to the parameters in the other command.
User avatar
rednoah
The Source
Posts: 23924
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Scripting: Parameters passes on cmd path?

Post by rednoah »

Assuming your original filebot command works, you can just replace that and call filebot.launcher, no Windows CMD, no stealing focus.

@see viewtopic.php?f=8&t=2116
:idea: Please read the FAQ and How to Request Help.
Post Reply