@echo off
title WinnableDirectories
rem Starts the WinnableDirectories app. Double-click this file. Keep the window open while you use the app.
cd /d "%USERPROFILE%"
set "NPX="
for /f "delims=" %%i in ('where npx.cmd 2^>nul') do if not defined NPX set "NPX=%%i"
if not defined NPX if exist "%ProgramFiles%\nodejs\npx.cmd" set "NPX=%ProgramFiles%\nodejs\npx.cmd"
if not defined NPX (
  echo.
  echo   WinnableDirectories needs Node.js, a free program from nodejs.org.
  echo   Your browser will now open the download page. Install the LTS version,
  echo   clicking Next on every screen, then double-click this file again.
  echo.
  start "" "https://nodejs.org/en/download"
  pause
  exit /b 1
)
echo.
echo   Starting WinnableDirectories. The first start can take a minute.
echo   Your browser opens by itself. Keep this window open while you use the app.
echo.
call "%NPX%" -y winnable@latest
echo.
pause
