Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 10-02-2021, 12:44 PM   #1
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 391
Karma: 3557934
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
Calibre CLI act oddly in Windows Batch

I've had an odd experience running the Calibre CLI in a bat file on Windows 10.

The file has three lines:
1. shut down running instances of Calibre ("calibre.exe --shutdown-running-calibre"
2. create a new catalog
3. restart Calibre in the tray ("calibre.exe --start-in-tray" ).

The batch file works as expected but it doesn't terminate: the last command
"calibre.exe --start-in-tray" runs and the window batch window stays open--the batch file never gets to the final line ("pause" or "exit").

It does this whether or not the "--start-in-tray" flag is present.

As I said, this doesn't mess up what I'm trying to do, but it seems to be the wrong behavior for a bat file.

Am I missing something?
slm is offline   Reply With Quote
Old 10-02-2021, 03:42 PM   #2
georgemk
Addict
georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.georgemk ought to be getting tired of karma fortunes by now.
 
Posts: 236
Karma: 291844
Join Date: Oct 2019
Device: Kobo Nia
You need to use the command "start" which will allow you to execute a program and then immediately exit the batch file leaving the program running.

Quote:
START

Start a program, command or batch script, opens in a new window.

Syntax
START "title" [/D path] [options] "command" [parameters]
More at https://ss64.com/nt/start.html - no affiliation with this site, just came up in Google results
georgemk is offline   Reply With Quote
Advert
Old 10-02-2021, 05:22 PM   #3
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 391
Karma: 3557934
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
Many thanks. You are of course correct that "Start" is the right way to do this.

I've never actually has to use "Start" before. In my experience, most programs open and pass execution to the next line without using it.

For example, if I use the same method to open Chrome:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

Chrome opens and the bat files continues on to the next line.

I wonder why some programs stop the bat file from going on and some don't.
slm is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mangas batch compressing (Windows only) farfeduc Kindle Developer's Corner 7 07-04-2013 05:37 PM
Seriously thoughtful Windows act as solar panels! The futuristic green house. Nexutix Lounge 1 04-18-2011 10:28 PM
Windows batch file to test, debug and develop recipes euleralves Recipes 8 04-01-2011 04:22 PM
Crash while batch converting epubs under windows AprilHare Calibre 3 04-26-2009 03:46 AM


All times are GMT -4. The time now is 02:24 PM.


MobileRead.com is a privately owned, operated and funded community.