Question Trying to set a text file's contents as a %var% then using that as youtube-dl %var%

Jun 3, 2019
8
0
10
0
the title says what i'm trying to do, but the code is not working for some reason, why?
Code:
@echo off
cd /d D:\123\p\youtube-dl\
start "" link.txt
:loop
timeout /t 1
type link.txt | findstr /i /c:"youtube"
if %errorlevel%==0 (set /p link=<link.txt
youtube-dl %link%
echo empty > link.txt
taskkill /im notepad++.exe /f
exit)
goto loop
 
Jun 3, 2019
8
0
10
0
nvm solved, the code was so messed up. this works:
Code:
@echo off
cd /d D:\123\p\youtube-dl\
start "" link.txt
:loop
timeout /t 2
type link.txt | findstr /i /c:"empty"
if %errorlevel%==0 goto loop
set /p link=<link.txt
youtube-dl %link%
echo empty > link.txt
taskkill /im notepad++.exe /f
exit
 

ASK THE COMMUNITY

TRENDING THREADS