Files
blog/write/setup-autostart.bat
T

33 lines
809 B
Batchfile
Raw Normal View History

2026-06-02 00:23:04 +08:00
@echo off
chcp 65001 >nul
echo ========================================
echo WriteBot Auto-Start Setup
echo ========================================
echo.
REM Check for admin rights
net session >nul 2>&1
if %errorlevel% neq 0 (
echo This script requires Administrator privileges.
echo Right-click this file and select "Run as administrator".
echo.
pause
exit /b 1
)
echo Creating scheduled task...
schtasks /create /tn "WriteBot" /tr "cmd /c cd /d E:\GitHub\blog\write && npm run dev -- -p 8016" /sc onlogon /rl highest /f
if %errorlevel%==0 (
echo.
echo [OK] WriteBot scheduled task created.
echo.
echo Verify: schtasks /query /tn "WriteBot"
echo Remove: schtasks /delete /tn "WriteBot" /f
) else (
echo.
echo [FAIL] Could not create task.
)
echo.
pause