Skip to content

Instantly share code, notes, and snippets.

@mattrayner
Created May 12, 2015 10:34
Show Gist options
  • Save mattrayner/6dd7482e587e971c59c3 to your computer and use it in GitHub Desktop.
Save mattrayner/6dd7482e587e971c59c3 to your computer and use it in GitHub Desktop.
MAMP redirect on Windows
@echo off
echo Creating a local redirect
echo =============================
SET /P IP=HOST IP: %=%
echo =============================
SET /P URL=URL: %=%
echo =============================
echo Adding to hosts file:
echo.
echo %IP% %URL%
echo.
pause
echo ==============================
echo Beginning write...
echo. >> C:\WINDOWS\System32\drivers\etc\hosts
echo %IP% %URL% >> C:\WINDOWS\System32\drivers\etc\hosts
echo ==============================
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment