running AMC script from CLI batch file

Any questions? Need some help?
Post Reply
DF2002
Posts: 4
Joined: 19 Feb 2013, 21:51

running AMC script from CLI batch file

Post by DF2002 »

Hello, I have been experimenting for 2 days with FileBot. I am so very close to a working set, yet frustratingly cannot get a final piece working.
I have FileBot .msi installed, and also installed with Chocolatey in x64 on the program and java.

I really just want to run the AMC script, and I can successfully run everything in command line.
However, I want to be able to automate that process without having to manually enter into the CLI.

So my question is, can I create a batch file to run automatically instead of manually typing into the CLI?

When I type this into the CLI it works perfectly:
filebot -script fn:amc "F:/incoming/downloading/" --output "Z:/NAS/Media" --action copy --conflict skip -non-strict

But I just can't figure out how to do this with a batch file. I have an external syncing program (NOT uTorrent) to obtain my downloads and it can run a post operation command or batch files when it completes. However, typing the above does nothing. I am successfully able to run other batch commands in the syncing app, so I know that they can be called and run.... but obviously I am doing something wrong in putting together a batch script to achieve AMC.

Any tips?
Thanks!!
DF2002
Posts: 4
Joined: 19 Feb 2013, 21:51

Re: running AMC script from CLI batch file

Post by DF2002 »

OK, 1 step forward.........

I saw the video tutorial for using utorrent-postprocess............. and after making a .bat file as per the tutorial I can run that script command directly by clicking on the .bat file and everything works as advertised.
However, when I try to run this as a process from another program, the black screen just flashes quickly and disappears. It appears to be saying something like "filebot is not recognized" or something along those lines.

So what would be the difference in clicking on the batch file directly, and running the batch file from another program?

btw, Win7 x64
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: running AMC script from CLI batch file

Post by rednoah »

You're using x64 windows so it'll open an x64 cmd.exe when you click the .bat file.

Your download manager is probably running in x86 compatibility mode, so if a x86 program is calling cmd.exe Windows will probably automatically make it call the x86 cmd.exe so PATH might be different in the 32 bit environment.

Easy fix might be using absolute paths in for both filebot.cmd when calling filebot and java.exe in the filebot.cmd to make sure you don't get the same "java is not recognized" issue.
:idea: Please read the FAQ and How to Request Help.
DF2002
Posts: 4
Joined: 19 Feb 2013, 21:51

Re: running AMC script from CLI batch file

Post by DF2002 »

Yes sir, you are indeed right--I am using an x86 program. So I downloaded a trial of the newest program which has x64, and the batch file works great.

So I have a decision to make.... either purchase the updated x64 edition which would solve my problem but cost me another license.
-or-
Try to force using an x64 cmd and x64 java. How difficult is that to do? When I installed I used Chocolatey and it did the 64 bit installs I guess for command line use? However, I am getting confused with the regular 64 bit filebot that I have installed which loads the GUI version of the program (and appears in my 64 bit c:\Program Files\FileBot). I don't think the GUI install has anything to do with the command line edition does it?

Thanks for the advice!
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: running AMC script from CLI batch file

Post by rednoah »

It's not hard. Just a PATH issue. As I said the easiest way is to use absolute paths to all the programs instead of relying on PATH being setup correctly.

1. Edit "C:/Program Files/FileBot/filebot.cmd" and replace 'java' with "C:/Program Files/Java/.../java.exe"
2. Instead of 'filebot' use "C:/Program Files/FileBot/filebot.cmd"
:idea: Please read the FAQ and How to Request Help.
Post Reply