简体   繁体   English

如何解决ebook-convert.exe(在便携式口径中)暂停批处理文件执行的问题?

[英]How to work around ebook-convert.exe (in calibre portable) halting batch file execution?

I use ebook-convert.exe from a batch file, and on one of my machines (old Windows vista laptop), any calls ebook-convert.exe prevent further commands in a batch file from running (in that .bat file, or in that cmd shell instance for instance). 我从批处理文件中使用ebook-convert.exe,在我的一台计算机(旧的Windows Vista膝上型计算机)上,任何调用ebook-convert.exe都会阻止批处理文件(在该.bat文件中或在该cmd shell实例)。 The conversion to .mobi actually succeeds, prints no errors even in -v -v full verbose mode. 实际上,向.mobi的转换成功,即使在-v -v完整详细模式下也不会输出任何错误。 I tried versions 1.20.0 and 0.9.6 of calibre portable. 我尝试了口径便携式版本1.20.0和0.9.6。 It seems to be related to the executable itself, and not to the specific conversion job (just running it with -h flag has same effect). 它似乎与可执行文件本身有关,与特定的转换作业无关(仅使用-h标志运行它具有相同的效果)。 I tried running cmd in administrator mode, wrapping it with 'call' command, nothing helps. 我尝试在管理员模式下运行cmd,并用“ call”命令将其包装起来,没有任何帮助。 Assuming the calibre issue is a black hole that can't be solved, is there a DOS trick I could possibly try to keep batch commands running no matter what odd thing happens with ebook-convert.exe on that machine? 假设口径问题是一个无法解决的黑洞,是否有DOS技巧可以使批处理命令保持运行,而不管该计算机上ebook-convert.exe发生什么奇怪的事情?

Using call in a batch file should work on normal console programs but it is possible for programs to "escape" if they really want to. 在批处理文件中使用call应该可以在常规控制台程序上使用,但如果程序确实愿意,可以“退出”程序。

Using Start instead might work but it does not wait by default and its syntax is not sane: 相反,可以使用“ Start来工作,但默认情况下它不会等待,并且其语法也不健全:

 Start /B /WAIT c:\path\without\spaces.exe optionalParameter

or 要么

 Start "" /B /WAIT "c:\path\w i t h\spaces.exe" optionalParameter

Remove /B to run the application in a new console. 删除/B以在新控制台中运行该应用程序。

Another option is to call ping localhost and For (to get the file size with %%~zA ) in a loop until the size of the destination file stops increasing. 另一种选择是循环调用ping localhostFor (以%%~zA来获取文件大小),直到目标文件的大小停止增加。 This is a bit of a hack and might not work, it depends on how the converter opens the file and how often it flushes the writes. 这有点破解,可能无法正常工作,这取决于转换器如何打开文件以及刷新写入的频率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM