Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7191

Batch file crashes after second "if"-statement

$
0
0

I tried to write a small batch script to start an application, but in the second IF statement the program seems to end without reason. I'm an absolute beginner in programming, so I would be glad if someone could explain the problem to me shortly.

I've already tried to figure out when the program quits, and it seems so alot if it does that directly with the

if "%pllst%"=="ja" (

does.

@echo off
:a
echo Standartplaylist? (ja/nein): 
set /p secq=
cls
if "%secq%"=="ja" (
    set vid=https://www.youtube.com/playlist?list=
) else (
    if /i "%secq%"=="nein" (
        echo Link zum Video oder zur Playlist: 
        set /p vid=
        cls
    ) else (
        goto a
    )
)
:b
echo Gesamte Playlist? (ja/nein): 
set /p pllst=
cls
if "%pllst%"=="ja" (
    :c
    echo Ordnername: 
    set /p direc=
    start cmd /k youtube-dl.exe%song_finish% --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail --prefer-ffmpeg -i -o %direc%/%%(title)s.%%(ext)s %vid%
    pause
) else (
    if "%pllst%"=="nein" (
        echo Ab welchem Song soll gestartet werden?: 
        set /p song=
        cls
        SET song_finish = " --playlist-start " + %song%
        goto c
    ) else (
        goto b
    )
)

I would have expected a simple execution of the second IF statement, which is not the case.


Viewing all articles
Browse latest Browse all 7191

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>