本地服务器域名重定向-可实现本地内测

@echo off&setlocal enabledelayedexpansion
cd/d "c:\Windows\System32\Drivers\Etc"
echo 127.0.0.1 localhost > hosts
set str1=192.168.0.X    www.xxoo.com 
set str2=192.168.0.X    www.ooxx.com 
(for /f "tokens=1* delims=:" %%i in ('findstr /n ".*" hosts')do (
  echo.%%j
  set hh=%%j
  set hh=!hh: =!
  if "!hh!"=="127.0.0.1localhost" ( echo.%str1% 
echo.%str2% 
)
))>yky.tem
move/y yky.tem hosts

 

你可能感兴趣的:(服务器)