@echo off setlocal cd /d "%~dp0" if exist venv ( if not exist venv\Scripts\python.exe ( echo Venv incompleto trovato, lo ricreo... rmdir /s /q venv ) ) if not exist venv ( echo Primo avvio: creo l'ambiente virtuale... python -m venv venv if not exist venv\Scripts\python.exe ( echo ERRORE: creazione venv fallita. Verifica che "python" sia nel PATH. pause exit /b 1 ) venv\Scripts\python.exe -m pip install --quiet --upgrade pip venv\Scripts\python.exe -m pip install --quiet -r requirements.txt ) if exist venv\Scripts\pythonw.exe ( start "" venv\Scripts\pythonw.exe diario_editor.py ) else ( start "" venv\Scripts\python.exe diario_editor.py )