How to silently execute a shell script that runs in the background

Support for Windows users
Post Reply
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:19, edited 1 time in total.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:20, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

If you run filebot.exe then it'll open a new CMD window if there isn't one already because filebot.exe is a Console executable. You can run the GUI with console so you can see the console output.

If you run filebot.launcher.exe it won't open a CMD window because filebot.launcher.exe is a GUI executable. You won't get a CMD window, but you also won't get console output. You can also use it to run filebot commands in the background.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:19, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

1.
Are you aware that you're running a Linux bash script on Windows?

2.
In your first line you call command.exe and filebot.exe so that'll definitely give you a console window (assuming your bash script works at all on Windows).
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:19, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

1.
I'm just surprised it's actually working. :D

2.
When you call command what executable is executed? Because if you execute cmd.exe or command.exe (Isn't this a very deprecated MS-DOS thing? Use cmd /c instead) then that will most definitely open a CMD window regardless of what program you're running in the new command prompt.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:20, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

1.
I presume that *.bat files are executed with CMD so that'll probably open a CMD window as well.


2.
You can use any filter you want. This particular age filter logic probably doesn't make much sense if you don't use the same number of days on both sides of the OR operator.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:20, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

@ECHO OFF does not do what you think it does. It'll just instruct CMD to not echo the commands it's executing.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: How to silently execute a shell script that runs in the background

Post by ZeroByDivide »

.
Last edited by ZeroByDivide on 16 Dec 2016, 21:20, edited 3 times in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to silently execute a shell script that runs in the background

Post by rednoah »

If you say it'll suppress the CMD window then I guess it does. I have no idea which one of your commands is spawning a CMD window. Just start with an empty script and rewrite it step by step making sure it doesn't spawn a CMD window after each step.
:idea: Please read the FAQ and How to Request Help.
Post Reply