Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating in Windows using -U or --update switch results in cmd crash #13618

Open
xCONFLiCTiONx opened this issue Jul 9, 2017 · 6 comments
Open

Updating in Windows using -U or --update switch results in cmd crash #13618

xCONFLiCTiONx opened this issue Jul 9, 2017 · 6 comments

Comments

@xCONFLiCTiONx
Copy link

@xCONFLiCTiONx xCONFLiCTiONx commented Jul 9, 2017

Updating in windows causes cmd to crash and I believe the problem is in the batch file code.

`
@echo off
echo Waiting for file handle to be closed ...
ping 127.0.0.1 -n 5 -w 1000 > NUL
move /Y "C:\Michael Hall\Workspace\Development\Old Projects\MediaDownloader\MediaDownloader\bin\Release\youtube-dl.exe.new" "C:\Michael Hall\Workspace\Development\Old Projects\MediaDownloader\MediaDownloader\bin\Release\youtube-dl.exe" > NUL
echo Updated youtube-dl to version 2017.07.09.
start /b "" cmd /c del "%~f0"&exit /b"

`

Should not the last line have 2 & and spaces? Eg. start /b "" cmd /c del "%~f0" && exit /b" or even better:
start /b "" cmd /c del "%~f0"
exit
untitled

Honestly I don't know but it gets stuck in cmd window and throws an error if using C# for example for standard output;

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 9, 2017

No, it should not.

@siddht4
Copy link

@siddht4 siddht4 commented Jul 10, 2017

Try this one once.Copy your executable to any folder residing in any other drive other than C. eg : In d: drive. paste youtube-dl.exe there. copy this into bat file @echo off youtube-dl.exe -U to update. Then try to download something. Try this @echo off youtube-dl [url]. Please provide did these two succed.

The first should update the youtube-dl.exe and close itself. The other should download some video which you provided instead of [url] and close itself.Anything other than these is a windows issue

@xCONFLiCTiONx
Copy link
Author

@xCONFLiCTiONx xCONFLiCTiONx commented Jul 10, 2017

I cant seem to narrow it down to where the problem is and I made a workaround for my application...

@siddht4
Copy link

@siddht4 siddht4 commented Jul 12, 2017

@mikeyhalla If the problem was fixed with a workaround you can help others who may have similar or same issue.

If you simply put these in your batch file,cmd would run,read the script,update youtube-dl and exit itself

the script being
@echo off youtube-dl.exe -U

If the script is not being called then either you dont have youtube-dl.exe in the path where the batch file is present or their is cmd restriction in your active directory.Which can done via invoking c:\windows\system32\cmd.exe.

By the way the error code is likely due to these issues. http://www.techsupportforum.com/forums/f10/solved-error-0xc0000142-178253.html

@xCONFLiCTiONx
Copy link
Author

@xCONFLiCTiONx xCONFLiCTiONx commented Jul 12, 2017

Yeah, thx but I tried pretty much everything to fix it and since I don't code in Python then I can't test youtube-dl. But just to let you know it only happens when the batch file is created for replacing the file.

My workaround was to create another exe that runs the update and ends before the update is finished so no error is even acknowledged.

I suggest the dev take a close look at this issue. I am pretty wise about my computer and this is the only program giving me problems. Bugs happen whether it be in youtube-dl or mine. I cant find it in mine so I just did the workaround.

@siddht4
Copy link

@siddht4 siddht4 commented Jul 12, 2017

okay but as I am a developer,not here though.If you have python 2.7 installed try this one once.Open this in browser or any dowonload manager https://yt-dl.org/downloads/latest/youtube-dl.You will find a 1.5 MB youtube-dl file.As soon as it downloads run cmd and type the command "python youtube-dl".If it works its ok so far.Then in the file add .zip extension and unzip it via winzip or winrar or any utlitiy. The folder structure will have

  • youtube-dl [folder]
  • main.py [file]

Navigate to this folder using cd,and once its reaches.Try this in terminal "python main.py ".If it works then write a batch script here that would contain these codes for now. @echo off python __main__.py set /p DUMMY=Hit ENTER to continue.... Run the batch script and tell which part had the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.