本页主题: NSIS 安装脚本命令 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

btxd
级别: 管理员


精华: 0
发帖: 112
威望: 112 点
金币: 50065 个
贡献值: 0 点
在线时间:53(小时)
注册时间:2020-04-18
最后登录:2026-09-17

 NSIS 安装脚本命令

在 hosts 文件中追加地址屏蔽脚本

ClearErrors
SetFileAttributes "$SYSDIR\drivers\etc\hosts" NORMAL #去只读属性
FileOpen $9 $SYSDIR\drivers\etc\hosts a #追加数据
FileSeek $9 0 END #指针定位到相对于文件结尾
FileWrite $9 "127.0.0.1 adcount.sandai.net $\r$\n"
FileWrite $9 "127.0.0.1 biz4.sandai.net $\r$\n"
SetFileAttributes "$SYSDIR\drivers\etc\hosts" READONLY #加只读属性
FileClose $9 #关闭打开的文件

nsExec::ExecToLog 'ipconfig /flushdns'  #hosts即时生效
顶端 Posted: 2020-11-08 18:14 | [楼 主]
帖子浏览记录 版块浏览记录
四四一七九 » 电脑综合技术应用

Total 0.007889(s) query 3, Time now is:09-18 15:31, Gzip enabled 鄂ICP备2023031436号
Powered by 四四一七九 © 2020-08 44179.com Corporation