在用户帐户上安装服务 [英] Installing a service on a user account

查看:77
本文介绍了在用户帐户上安装服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的问题是,我写了一个小型服务,每次打开计算机时都会清理我的几个缓存"文件夹(我在工作时使用该文件夹,非常混乱).它应该可以正常工作,因为我将其作为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小时运行一次,也可以在每次启动后运行. http://msdn.microsoft.com/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. http://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.80%29.aspx[^] What OS? Windows 7? Vista? XP?


这篇关于在用户帐户上安装服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆