在用户帐户上安装服务

编程入门 行业动态 更新时间:2024-10-26 19:34:27
本文介绍了在用户帐户上安装服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好, 我的问题是,我写了一个小型服务,每次打开计算机时都会清理我的几个缓存"文件夹(我在工作时使用该文件夹,非常混乱).它应该可以正常工作,因为我将其作为Windows应用程序进行了测试,并且可以正常工作.但是我希望每次打开计算机时都能自动运行,并且希望在后台完成此操作,而无需通知我. 我创建了该服务并添加了Project Installer,但是由于我没有完全访问"特权帐户,因此无法安装该东西.我是这台机器上的普通用户. 我试图将ServiceProcessInstaller的Account属性设置为User和LocalService,但是我无法以两种方式安装它.每当我尝试"installutil"它时,System.Security.SecurityException都会引发此异常,然后它会回滚安装. 有没有办法操纵我的特权一次并安装此服务?将来我可能需要安装其他各种服务,这对我来说似乎是一个严重的问题. 我对Windows Services还是相当陌生,非常感谢您的帮助. 谢谢.

Hello, My problem is that, I wrote a small service that will clean my several "cache" folders (which I use while I''m working and get cluttered pretty badly) every time I open my computer. It should be working just fine, because I tested it as a Windows Application and it works fine. But I want this to work automatically every time I open my computer and I want this to be done at the background, without notifying me. I created the service and added the Project Installer but I cannot install the thing because I do not have a Full-Access privilege account. I''m an ordinary user on this machine. I''ve tried to set the ServiceProcessInstaller''s Account property to User and LocalService but I couldn''t manage to install it in neither ways. System.Security.SecurityException throws this exception every time I try to "installutil" it, then it rolls back the installation. Is there a way to manipulate my privileges for just this once and install this service? I may need to install various other services in the future, and this appears to be a serious problem for me. I''m fairly new with Windows Services and I would really appreciate any help. Thanks.

推荐答案

您是否尝试过将其添加为Windows任务?您可以将其配置为每24小时运行一次,也可以在每次启动后运行. msdn.microsoft/en-us/library/zt39148a%28v = vs.80%29.aspx [ ^ ]什么操作系统? Windows 7的? Vista? XP? Have you tried adding it as a Windows Task? You can configure it to run every 24 hours or at every boot from there. msdn.microsoft/en-us/library/zt39148a%28v=vs.80%29.aspx[^] What OS? Windows 7? Vista? XP?

更多推荐

在用户帐户上安装服务

本文发布于:2023-06-10 22:56:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/620863.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帐户   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!