Adam-Kay / Batch-Encoder

Command line batch file encoder using FFmpeg
GNU General Public License v3.0
0 stars 0 forks source link

End of program error: `The batch file cannot be found.` #47

Open Adam-Kay opened 10 months ago

Adam-Kay commented 10 months ago

Bug Description

As development into 1.7.3 continues, there is an issue after update with the following error right at the end of the program:

[Completed encoding 1 files.]
[Skipped 4 invalid files.]

The batch file cannot be found.
The batch file cannot be found.

Steps to Reproduce

Using latest iteration (17f2216 in this case)

  1. Open terminal
  2. Command: batch encoder.bat --silent --update force --ffmpegloc ffmpeg.exe
  3. Wait for process to complete
  4. See error message listed above

Potential Cause

According to one stack overflow answer:

To not go too much into detail: This message is given when a batch file (.bat) that currently runs has been deleted between it's start and the time the error message is shown.

So the program is having a potential problem where it is deleted before it can finish executing (external wrapper having trouble most likely).

Adam-Kay commented 10 months ago

Based on extensive experimentation, I think that using (goto) 2>nul & cmd /c file will be essential to getting this to work correctly.

Adam-Kay commented 9 months ago

cmd /c seems non-viable as it starts a new cmd instance which means if it crashes, it just seems to spit out an error code and the wrapper has no way to handle it until the user types in exit. which is highly countermount to this whole feature addition