Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Created March 11, 2026 14:20
Show Gist options
  • Select an option

  • Save n1ckfg/79c001043d83497277d9bcc922fb57a3 to your computer and use it in GitHub Desktop.

Select an option

Save n1ckfg/79c001043d83497277d9bcc922fb57a3 to your computer and use it in GitHub Desktop.
@echo off
set PORT=8080
:findport
netstat -ano | findstr ":%PORT% " | findstr "LISTENING" >nul 2>&1
if %errorlevel%==0 (
set /a PORT+=1
goto findport
)
start http://127.0.0.1:%PORT%
http-server -p %PORT%
@pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment