windows-services

Calling System.exit() in Servlet's destroy() method

This is a follow up to my earlier question. Tomcat 5.0.28 had a bug where the Servlet's destroy() method was not being invoked by the container on a shutdown. This is fixed in Tomcat 5.0.30, but if the Servlet's destroy() method had a System.exit(), it would result in the Tomcat windows service throwing the Error 1053 and refusing to sh...

Polling Long Running Windows Service from ASP.NET

We have an application that uses Lucene.NET within a windows service to reindex our app for search. Our admin section can trigger a full reindex in Lucene, and currently the only way to review its progress is through a log file written to disc. This is clunky. We'd like to poll the service to determine the reindexing progress. Does a...

How to give a Window Service access on a remote machine?

I'm working on a Windows Service that one of its tasks is archiving files on remote machine but I've problem regarding access privileges "Access id denied". The service account is "LocalService", How can I give service access to remote machine? ...

How can I give a windows service access on a remote machine in case of Workgroup?

I'm working on a Windows Service that one of its tasks is archiving files on remote machine but I've a problem regarding access privileges in case of Workgroup. ...

Delay service at system startup.

I'm using VB 9. I want the only thread in my Windows Service (that is set to Automatic) to start its work 5 minutes after Windows starts. But if the user restarts the service manually, the thread should start working immediately when the service starts. How do I achieve this? ...

Check if no user is currently logged on to Windows

I'm writing a Windows Service application which listens for connections and performs certain tasks as instructed from a different application running on another computer on the network. One of the tasks ensures no user is currently logged on, locks the workstation, delete some files, and then restarts the system. I considered using this...

Running a Java process in Windows even after the user is logged out

I have a batch file that starts a Java process in a Windows 2003 server. As per the security policy, the users of that machine are logged off forcefully, if the user is inactive for a certain period of time. The problem is that when the user is logged out, the process also dies. I scheduled a new task (Control Panel -> Scheduled Tasks) ...

Can a service written in .NET self-terminate?

I have a service application written in C# and under certain circumstances, I would like it to terminate itself. This would happen after the service has been running for a while, so this would not be happening in the OnStart() event. Everything that I have read so far suggests that the only safe way to terminate a service is through th...

How do I start multiple Windows Services at once, with one command?

My primary computer for programming is the same computer I use for gaming etc. So to increase speed while gaming I turned off services like Apache, MySQL, Subversion etc. from starting at boot as I use it about 50/50 for gaming/programming. This is fine most of the time but it's a bit of a nuisance to start them all separately. Could s...

windows service stops and starts immediately, but it shouldn't

I'm creating a windows service and after installing the service, it stops and starts immediately, but it shouldn't be at all. Previously, I was getting errors that the service was not responding to the start command in a timely fashion, so I took the init code out and put it in a thread, and now I am here: protected override void OnStar...

How can I manage which items are in the ThreadPool?

I have a windows service that runs a method when the services main Timer elapses (OnElapse). The OnElapse method gets a list of .xml files to process. Each xml file is inserted into a ThreadPool. I want to make sure I don't insert 2 XML's with the same name into the ThreadPool. How can I manage which items are in the ThreadPool? I ba...

Launching a .Net winforms application interactively from a service

Environment - VS2008, Vista SP1. I have written a process management service which can launch applications either in session 0 or the interactive console (usually 1). Please note this is NOT the normal mode of operation, it's for in-house debug purposes only. In the field, these processes will be safely hidden away in session 0. Securit...

Communication between Windows service and applications in different user sessions

I have the following situation: Windows Server environment with multiple user sessions. Windows Service is listening on well known port. Tray application in each user session which is started automatically. Silverlight (SL) application is running in browser and communicating with Windows Service using sockets and predefined port. My...

Finding out Windows service's running process name .NET 1.1

We are using a badly written windows service, which will hang when we are trying to Stop it from code. So we need to find which process is related to that service and kill it. Any suggestions? ...

How can I create a Windows application that can run with a GUI *or* as a Windows service in C#?

I'd like to create an application using C# that...: Can be run as a Windows application, with a GUI (it'll indicate progress, status, etc.) OR Can be run as a Windows service, without a GUI Is it possible? Can someone get me started? I guess the alternative is that I could create a Windows service, and then a separate GUI applicat...

Working example of connecting a Windows Service to QuickBooks...?

Can anyone provide a working example of a Windows Service that connects to QuickBooks desktop editions? I can get my console application to connect fine using their sample code in the QuickBooks SDK, but it doesn't seem to do anything as a Windows Service... ...

How does Basic Authentication when dealing with an HttpListener work?

This might seem like a basic question and back to Http protocol 101. But I am having difficulty in understanding how Basic Authentication works. I am implementing a windows service and need it to be secure. I would like to obtain the user name and password and authenticate the user to a custom user store. I also want to minimize the n...

Easier way to start and stop windows services in Windows XP

I occasionally find myself starting and stopping multiple windows services. The only tool I'm aware of for stopping and starting windows services is the "Services" program under "Administrative Tools" (%SystemRoot%\system32\services.msc /s). This program seems to only allow you to manipulate one service at a time, often pausing while i...

System error 5 Access is denied when starting a .NET service

When I try to start a service I created in Visual Studio I receive the following error: System error 5 has occurred. Access is denied. I am running the command line with elevated privileges, so it's not that problem. Is there any place I can look to see what error is occuring. ...

Control a service from another application in Vista

Hi all, I'm wondering if it's possible to create a windows service in .NET and then create another windows.forms process that connects to the service and passes parameters, modifies and views its datastructures and connected database, etc. I believe that in Vista this is only possible with the use of sockets, and not with a ServiceContr...