Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Change the batch processing of hosts files with bat

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Add mapping between ip and domain name

@ ECHO offECHO "XXXXXX Technology Co., Ltd."ECHO" Please pay attention to your antivirus software tips Be sure to allow "@ ECHO # # @ xcopy C:\ Windows\ system32\ drivers\ etc\ hosts C:\ Windows\ system32\ drivers\ etc\ hosts.bak\ / d / c / I / y@ECHO # # @ ECHO hosts file backup completed Start modifying hosts file @ ECHO@ECHO 10.0.0.2 gitlab.a.com > > C:\ Windows\ System32\ drivers\ etc\ hosts@ECHO 10.0.0.3 gitlab.b.com > > C:\ Windows\ System32\ drivers\ etc\ hosts@ECHO 10.0.0.4 gitlab.c.com > > C:\ Windows\ System32\ drivers\ etc\ hostsECHO "hosts file modification completed" @ ipconfig / flushdns@ECHO "refresh DNS complete" @ ECHO "press any key to exit" @ pause > nul@exit "

Restore backed up hosts files

When the echo hosts file has been modified, press any key to restore the original state of the system @ echo@echo # # @ pause > nul@copy C:\ Windows\ System32\ drivers\ etc\ hosts.bak\ hosts C:\ Windows\ System32\ drivers\ etc\ hosts / y@echo@echo offecho hosts file, press any key to exit @ echo@pause > nul@exit

What's wrong with the hint? Please check whether the environment variable or encoding format is ANSI

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report