windows-services

Is there any way, in java, to check on the status of a windows service?

I am looking for a library that will allow me to look up the status of a windows service to verify that the service is started and running. I looked into the Sigar library, but it is GPL and therefor I cannot use it. A Commercial or BSD(ish) license is required as this will be bundled into commercial software. ...

What are the access restrictions on accessing a DSN

We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. access a system DSN unless the account that is running the service ha...

Starting service as a user with no password

Hello all, I'm trying to start a service as a user and things work fine, until I try a user that doesn't have a password. Then, it fails to start (due to log-on error). Am I doing something wrong or is this "by design"? The code to register this service: SC_HANDLE schService = CreateService( schSCManager, strNameNoSp...

How do I create an installer for a .Net website, Windows Service, and more???

I need to create an installer program that will do install the following: ASP.Net Website Windows Service SQL Express if it isn't installed and the user doesn't have a SQL Server Dundas Charts ASP.Net AJAX v.1.0 ReportViewer control (for 2.0 Framework) Check Framework prerequisites (2.0) Configure IIS and app.config (data connection s...

How do you retrieve a list of logged-in/connected users in .NET?

Here's the scenario: You have a Windows server that users remotely connect to via RDP. You want your program (which runs as a service) to know who is currently connected. This may or may not include an interactive console session. Please note that this is the not the same as just retrieving the current interactive user. I'm guessing t...

Moving WCF service from IIS to a Windows service

We have an existing WCF service that makes use of wsDualHttpBinding to enable callbacks to the client. I am considering moving it to netTcpBinding for better performance, but I'm quite wary of moving away from the IIS-hosted service (a "comfort zone" we currently enjoy) into having our own Windows service to host it. I was hoping we coul...

Using InstallUtil and silently setting a windows service logon username/password

I need to use InstallUtil to install a C# windows service. I need to set the service logon credentials (username and password). All of this needs to be done silently. Is there are way to do something like this: installutil.exe myservice.exe /customarg1=username /customarg2=password ...

Catching 'external drive inserted' event in a windows service

I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this: Whenever a particular device is plugged in (via USB), it: Deletes everything from the device Checks for all the latest entries in a number of RSS Podcast feeds Downloads those to the device Notifies the user a...

ChangeServiceConfig problem setting logon credentials

I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service (I CreateService it myself) to supply the logon credentials, but while the function succeeds (returns TRUE), if I try to start the service, it fails with a 1069 (logon failed). If I go into the service manager and modify credentials by hand (I can ...

Error 1053: the service did not respond to the start or control request in a timely fashion

i know this is very much a "how long is a piece of string" type of question, however i have recently inherited a couple of applications that run as windows services, and i am having problems providing a gui (accessible from a context menu in system tray) with both of them. before you ask, the reason why we need a gui for a windows servi...

C# Windows Service - Handle Exception on Startup

I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (OnStart). I had assumed that merely throwing an error in OnStart would do this, but I'm finding that instead it "Starts" and presents me with a message stating "The service has started, but is inactive. Is this correct?" (Paraphrase). H...

Windows services with windows forms in the same process

Hello, I have a c# application that runs as a windows service controlling socket connections and other things. Also, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration parameters). I'm using .net remoting to do the IPC and that was fine, but now I want...

Running a Ruby Program as a Windows Service?

Is it possible to run a ruby application as a Windows Service? I see that there is a related question which discusses running a Java Application as a Windows Service, how can you do this with a Ruby application? ...

Writing a Scheduled Windows Service in .NET

I want to write a windows service which the user can schedule. i.e, the user can choose to run the service from 9:00 AM to 6 PM daily, or he could run it every night, starting from night 12 o clock at night to next day morning 6, etc. Is there any out of the box .NET API that will help me do this? I know I can do this using the Scheduled...

How can I run a CLI Application as a Windows Service?

Say I have a third party Application that does background work, but prints out all errors and messages to the console. This means, that currently, we have to keep a user logged on to the server, and restart the application (double-click) every time we reboot. Not so very cool. I was kind of sure, that there was an easy way to do this -...

What is the best way to install a C# windows service that doesn't require running installutil manually?

I'd like to package a C# windows service project so it can be easily installed by anyone without having to use installutil command prompt utility? Is there an easy way to configure a Visual Studio setup project to do that similar to how winforms applications are installed? ...

Running an exe from windows service that interacts the the user's desktop

I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task Manager - i can see that the application is running but I just cannot see it. I have checked ...

How can I verify if a Windows Service is running

Hi, I have an application in C# (2.0 running on XP embedded) that is communicating with a 'watchdog' that is implemented as a Windows Service. When the device boots, this service typically takes some time to start. I'd like to check, from my code, if the service is running. How can I accomplish this? Thanks ...

Minimum rights required to run a windows service as a domain account

Hi all, Does anyone know what would be the minimum rights I would need to grant to a domain user account in order to run a windows service as that user? For simplicity, assume that the service does nothing over and above starting, stopping, and writing to the "Application" event log - i.e. no network access, no custom event logs etc. ...

How to map a network drive to be used by a service

Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as the service user and creating a persistent mapping will not establish the mapping in the context of the actual service. ...