Update and download in one .bat file #21313

Closed
opened 2026-02-21 10:19:53 -05:00 by deekerman · 2 comments
Owner

Originally created by @greyboxgt on GitHub (Aug 6, 2020).

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

WRITE QUESTION HERE

I am trying to make a script that would update my youtube-dl.exe and then download some titles. Here is my .bat file:

youtube-dl -U --no-check-certificate
mydownload.bat

The problem is that mydownload.bat command starts before the update is finished and the file handle is closed. Because access to youtube-dl.exe is denied at that time, I end up with my old youtube-dl.exe and new youtube-dl.exe.new. Is there a way to force mydownload.bat in the script to wait until the update process is finished?

Originally created by @greyboxgt on GitHub (Aug 6, 2020). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions - Search the bugtracker for similar questions: http://yt-dl.org/search-issues - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm asking a question - [x] I've looked through the README and FAQ for similar questions - [x] I've searched the bugtracker for similar questions including closed ones ## Question <!-- Ask your question in an arbitrary form. Please make sure it's worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. --> WRITE QUESTION HERE I am trying to make a script that would update my youtube-dl.exe and then download some titles. Here is my .bat file: ``` youtube-dl -U --no-check-certificate mydownload.bat ``` The problem is that mydownload.bat command starts before the update is finished and the file handle is closed. Because access to youtube-dl.exe is denied at that time, I end up with my old youtube-dl.exe and new youtube-dl.exe.new. Is there a way to force mydownload.bat in the script to wait until the update process is finished?
deekerman 2026-02-21 10:19:53 -05:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dstftw commented on GitHub (Aug 7, 2020):

Read doc on batch files for whatever delay capabilities it provides.

@dstftw commented on GitHub (Aug 7, 2020): Read doc on batch files for whatever delay capabilities it provides.
Author
Owner

@greyboxgt commented on GitHub (Aug 7, 2020):

youtube-dl -U --no-check-certificate generates a batch file that I cannot control.
I can add some delay in mydownload.bat but this would be a guessing game.

@greyboxgt commented on GitHub (Aug 7, 2020): youtube-dl -U --no-check-certificate generates a batch file that I cannot control. I can add some delay in mydownload.bat but this would be a guessing game.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#21313
No description provided.