Skip to content

Instantly share code, notes, and snippets.

@jayaregalinada
Created February 25, 2017 14:36
Show Gist options
  • Save jayaregalinada/283c23196ccc6046c3e76668b097fb69 to your computer and use it in GitHub Desktop.
Save jayaregalinada/283c23196ccc6046c3e76668b097fb69 to your computer and use it in GitHub Desktop.
Add IP and URL to hosts file (Windows)
@echo off
title Add Hosts
set arg1=%1
set arg2=%2
IF "%1"=="" goto empty
IF "%2"=="" goto empty
echo %arg1% %arg2%
echo %arg1% %arg2% >> %WINDIR%\System32\drivers\etc\hosts
goto commonexit
:empty
echo "Usage: addhosts {IP} {URL}"
exit /b 1
:commonexit
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment