如何为 Visual Studio 中内置的 EXE 文件创建具有管理员权限的 Windows 控制台应用程序?
我创建了一个简单的 Win32 控制台应用程序来表示“hello world.exe”。当我打开 EXE 文件时,它没有管理员权限,但是当我以管理员身份运行它时,控制台路径会更改为某个 C:\sys
而不是“hello world.exe”的路径”。
如何赋予管理员正常打开的权限或以管理员身份运行时更改“hello world.exe”的路径?
I created a simple Win32 console application to say "hello world.exe". When I open the EXE file, it doesn't have administrator rights but when I run it as administrator the console path gets changed to some C:\sys
rather that the path of the "hello world.exe".
How do I give the administrator rights with normal open or change the path to "hello world.exe" when running it as administrator?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以添加请求管理员权限的应用程序清单。这是推荐的方法。
You can add an application manifest which requests Administrator privileges. This is the recommended approach.