找回密码
 加入
搜索
查看: 24|回复: 1

[系统综合] 求助删除hpst

[复制链接]
发表于 昨天 14:38 | 显示全部楼层 |阅读模式
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#        127.0.0.1       localhost
#        ::1             localhost
132311231231
127.0.0.1 mail.casetekcorp.com
127.0.0.1 csmail.casetekcorp.com
127.0.0.1 cjsmail.casetekcorp.com
127.0.0.1 yrkmail.casetekcorp.com
127.0.0.1 autodiscover.casetekcorp.com
127.0.0.1 autodiscover.intra.casetekcorp.com怎么写删除127.0.0.1 mail.casetekcorp.com
127.0.0.1 csmail.casetekcorp.com
127.0.0.1 cjsmail.casetekcorp.com
127.0.0.1 yrkmail.casetekcorp.com
127.0.0.1 autodiscover.casetekcorp.com
127.0.0.1 autodiscover.intra.casetekcorp.com这个具体咋写写了删除不了 ,还望大神指点指点
发表于 昨天 16:25 | 显示全部楼层
本帖最后由 smallan 于 2024-9-22 16:27 编辑

#include <File.au3>
#include <Array.au3>
Local $aRetArray, $sFilePath = "C:\windows\system32\drivers\etc\hosts", $sDelString = "127.0.0.1 mail.casetekcorp.com"
FileOpen($sFilePath)
_FileReadToArray($sFilePath, $aRetArray)
$iSearch = _ArraySearch($aRetArray, $sDelString)
_FileWriteToLine($sFilePath, $iSearch, "", 1)
FileClose($sFilePath)


您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 05:16 , Processed in 0.082129 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表