视频加载失败

【Golang】Golang在Windows上获取管理员权限

84 字
1 分钟
【Golang】Golang在Windows上获取管理员权限
【Golang】Golang在Windows上获取管理员权限

0x00#

此方法可以双击程序获取权限

0x01#

1.打开命令终端输入:

Terminal window
go get github.com/akavel/rsrc

2.在项目根目录创建名为nac.manifest的文件,并填充以下内容:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

3.项目根目录下打开命令行输入:

Terminal window
rsrc -manifest nac.manifest -o nac.syso
go build

0x02#

END#

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!

打赏
【Golang】Golang在Windows上获取管理员权限
https://rehtt.com/posts/154/
作者
Rehtt
发布于
2019-04-11
许可协议
CC BY-NC-SA 4.0

评论区

Profile Image of the Author
Rehtt
Hello, I'm Rehtt.
公告
欢迎来到我的博客!
分类
标签
最新动态
站点统计
文章
150
分类
17
标签
73
总字数
67,772
运行时长
0 天
最后活动
0 天前
站点信息
构建平台
Local
博客版本
Firefly v6.16.8
文章许可
CC BY-NC-SA 4.0
文章目录