@echo off

set "CONFIG=%~dp0path.txt"
set "YOUTUBE_DIR=%USERPROFILE%\SendTo\YouTube"
set "IPLAYER_DIR=%USERPROFILE%\SendTo\iPlayer"

if not exist "%CONFIG%" exit /b 0

for /f "usebackq tokens=1,* delims==" %%A in ("%CONFIG%") do (
  if not "%%~A"=="" if not "%%~A:~0,1%"==";" (
    if /I "%%~A"=="YOUTUBE_DIR" set "YOUTUBE_DIR=%%~B"
    if /I "%%~A"=="IPLAYER_DIR" set "IPLAYER_DIR=%%~B"
  )
)

call set "YOUTUBE_DIR=%YOUTUBE_DIR%"
call set "IPLAYER_DIR=%IPLAYER_DIR%"
exit /b 0
