在 Windows 7 中安装 Windows 服务

发布于 2024-10-07 09:37:13 字数 147 浏览 0 评论 0原文

我在 XP 中使用安装服务的代码:

@"%windir%\Microsoft.NET\Framework\v2.0.50727\Path  +@"\service.exe

但在 Windows 7 中此代码有问题

i use the code for install Service in XP:

@"%windir%\Microsoft.NET\Framework\v2.0.50727\Path  +@"\service.exe

But in Windows 7 this code is problem

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

把梦留给海 2024-10-14 09:37:13

在 Windows 7 中,您必须以管理员身份运行命令行才能正常工作。

为此,请单击“开始”“orb”,照常输入“cmd”,但不要按 Enter,而是同时按住 CTRL+SHIFT,然后按 Enter。将出现对话框,确认它,您将获得管理访问权限,并且安装应该按预期进行。

In Windows 7 you have to run the command line as admin for this to work.

To do that, click the Start "orb", type "cmd" as usual but instead of pressing Enter, hold CTRL+SHIFT together then press Enter. Dialog will appear, confirm it and you'll get administrative access and the installation should work as expected.

彡翼 2024-10-14 09:37:13

通常,我使用“installutil.exe -i myAppExe”命令进行安装。不能用这个命令吗?

Normally, I use "installutil.exe -i myAppExe" command for installing. Cant you use this command?

森林很绿却致人迷途 2024-10-14 09:37:13

只有提升的进程(仅作为管理员组成员登录计算机是不够的)才能安装服务。如果您是从命令提示符执行此操作,请将其设置为提升的命令提示符(右键单击快捷方式并选择“以管理员身份运行”,以及 @Shadow Wizard 的说明)。如果您在代码中执行此操作,则应用程序将需要被提升。

Only an elevated process (it is not enough to be logged into the machine as a member of the Administrators group) can install a service. If you're doing it from the command prompt, make it an elevated one (right clicking the shortcut and choosing Run As Administrator works, as well as @Shadow Wizard's instructions.) If you're doing it in code, the app will need to be elevated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文