Small interest: Modify the Hosts file to prohibit access to the specified Web page

Source: Internet
Author: User
Tags echo command file copy

Do not know the hosts file what ghost Friends can search on the Internet (Daniel do not spray-)

When visiting the URL, first query the local HOSTS file, then if we change the URL in the Hosts file with the IP map, the wrong IP will be accessed.

Append at end of file:127.0.0.1 www.baidu.com

Normal situation does not have administrator above permissions, is unable to modify the Hosts file (process injection, create services, tamper with the registry, directly take the system permissions, to ignore)

Method 1: In the user group, the current system user is referred to as Administrator right

Method 2: Copy the original Hosts file, modify and paste it back

  

In the case of write bat file implementation, if you do not have the administrator above permissions, then directly modify the Hosts file failed. We can run implementation modifications as an administrator.

The problem comes again, anti-virus software tip: The Hosts file was modified.

Rescue: Write BAT file copy with copy command, echo command append

No prompt! No prompt! No prompt!

Then, when writing other scripts, the script runs the bat file ...

Small interest: Modify the Hosts file to prohibit access to the specified Web page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.