I want to use this batch script to add new entries into my host file automatically by using windows batch.
I want to edit host file only when i m in office. I want to say like that: if(network name=='OfficeWifi') do changes...
@echo off
set hostspath=%windir%\System32\drivers\etc\hosts
// if(network name=='OfficeWifi')
echo 81.155.145.48 ns1.intranet.de >> %hostspath%
exit
thx for your help
You can get the network name (SSID) of the currently connected wireless network using the following batch file:
So your batch file would look like:
Sources FOR /F, NETSH (Network Shell)