Skip to content

Instantly share code, notes, and snippets.

@andreasneuber
Created July 19, 2020 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasneuber/d7233841f1386bb2cfb7f989e3b846ea to your computer and use it in GitHub Desktop.
Save andreasneuber/d7233841f1386bb2cfb7f989e3b846ea to your computer and use it in GitHub Desktop.
Windows - Batch for adding entries to host file
@ECHO OFF
TITLE=Update Hosts File
set /p ip_address="Enter ip adress: "
set /p domain="Enter domain: "
copy C:\Windows\System32\drivers\etc\hosts C:\Windows\System32\drivers\etc\hosts.bck
ECHO. >> C:\Windows\System32\drivers\etc\hosts
ECHO %ip_address% %domain% >> C:\Windows\System32\drivers\etc\hosts
PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment