Click here to Skip to main content
15,888,590 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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?
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 23-Jul-11 0:28am    
Makes sense, my 5. Actually, this is still a Windows Service, only the one which is already available.
--SA
Thomas Mack 23-Jul-11 2:50am    
I develop a small piece of software to run like this but I didn't create it as a service. Just a command prompt, pops up, closes. Of course this is on a server and you might not want that. Good luck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900