windows-services

Graphic Compatibility with Microsoft .NET

I have created a small application using Microsoft .NET. I don't have problems with MS .NET versions, the problem is with the 2.0 version itself. It's a graphic problem. The application doesn't show the same user interface on two different Windows XP. One with a classic style and the other is XP style. Also this doesn't show the same un...

How does one map network drive from windows service?

I'm trying to map network drive from windows service, I use batch file for executing the following command NET USE U: \\192.168.55.6\folder password While executing batch file either in service constructor or in onstart event, drive is not mapped? Process process = new Process(); process.StartInfo.FileName = System.IO...

Starting a windows service fails with error 1053

I have a windows service that is failing to start, giving an error "Error 1053: The service did not respond to the start or control request in a timely fashion". Running the service in my debugger works fine, and if I double click on the the service .exe on the remote machine a console window pops up and continues to run without proble...

Be notified of an IIS Reset ?

We have a system with a web app and a bunch of Windows Services doing some background work. Whenever we need to make a more substantial change to the system, we end up having to issue an IIS Reset, and then manually restart all relevant Windows services. Is there any way at all to be notified of such IISReset events in C# code, so that...

What are valid characters in a Windows service (key) name?

Does anyone happen to know what the convention for Windows service key names is, which characters are legal? ...

Windows command to get service status?

I need to know the status of a service at the end of my batch script which restarts services using "net stop thingie" and "net start thingie". In my most favorite ideal world, I would like to e-mail the state to myself, to read on cold winter nights, to reassure myself with the warmth and comfort of a server that I know is running right...

WCF Timing out from Windows Services but not Web Applications

Hi All I am currently having an issue calling a WCF service from a windows service. My Application Solution looks like this. Web Administration Console (Web Project) Central Control (Windows Service) WCF service so the Web Administration Console can connect to it and configure it Several Calls to use WCF on the Node (Window Service) ...

Create a combo command line / Windows service app

What's the best way in C# to set up a utility app that can be run from the command line and produce some output (or write to a file), but that could be run as a Windows service as well to do its job in the background (e.g. monitoring a directory, or whatever). I would like to write the code once and be able to either call it interactive...

Multiple Windows Services in One exe

I am trying to build several Windows services to do different things. For instance, I need Windows services that will: Send a daily report via email Periodically cleanup some archived info every 30 minutes etc. The tasks I need the windows services to do are distinct so I don't really like the idea of having them all in one service....

How to Start/Stop a Windows Service from an ASP.NET app - Security issues

Hey guys, here's the setup (bear in mind I'm really struggling with the Windows/.NET security stack i.e. I don't get it): A Windows Service running as LocalSystem on a Windows Server 2003 box. A .NET 3.5 Website running on the same box, under "default" production server IIS settings (so probably as NETWORKSERVICE user?) On my default...

What's the best way to implement a scheduled job using a windows service

I have a database job that runs occasionally at night and I need a windows service to poll the database regularly to do some more work after the SQL job is done. I am a looking for a solid example to write a scheduler that can fail gracefully without crashing the service. ...

Shared configuration files in .NET

I have a solution that includes both a web and a Windows NT service application. These are of course two different projects but within the same solution. They do however share a lot of the same configuration. Currently I have the same values in both the web.config and the app.config file. This is starting to get messy and I'd like to h...

Creating an MSI installer for a Windows Service

I have a window service project in visual studio 2008. I've also added the setup and deployment project. Unfortunately, when I install it, the services does not show up in the services mmc snapin. I have already added the ProjectInstaller to the service project, and I've followed the instructions here already: http://www.branded3.com/c...

How to know which Local Application Connected to my socket (Windows)

I have a windows services that bind to some TCP port, this port is use for IPC between my application. Is there a programming (WinAPI/WinSocket and etc) way to know which application connected to my port? i.e. in my Windows Services I would like to get a PID of the process that connected to my port. ...

How to tell if process is run by the Service Control Manager

I have a few Windows Services written in C# that I have setup to support being run from the command line as a console app if a specific parameter is passed. Works great but I would love to be able to detect whether the app is being run by the service control mananger or from a command line. Is there any way to tell at runtime if my app ...

VB.NET Timer question

Guys, I wrote a VB.NET Windows Service, which works fine. I have only one issue with it. I want the service to execute on the half hour and top of the hour marks (e.g. 9:00, 9:30, 10:00, 10:30, 11:00, etc etc etc). I am using the following code: Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your s...

What is the default current working directoy of a service in Windows?

I'm adapting a program to run as a service, and the first thing it does is open a local configuration file, but it doesn't exist because I don't know what is the current directory. ...

Cannot access Python server running as Windows service

I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create a Windows service. I installed it on a computer running Windows XP Pro SP3. However, I can't connect to it when it's running as a service. I can confirm that it's binding to the address/port, because I get a conflict when I try to bind to tha...

Windows Service is not working in Outlook 2003/2007

Hi, Currently, I am working on windows service using outlook 2003 and 2007. The winform able connect and read the mails with local outlook 2003/2007. But the window service is not all invoking the outlook 2003/2007 module. Could you please help me, you have any idea about this. ...

How do I configure the name of a Windows service upon installation (or easily at compile time)?

I've created a Windows service in C#, installed it on a server and it is running fine. Now I want to install the same service again, but running from a different working directory, having a different config file etc. Thus, I would like to have two (or more) instances of the same service running simultaneously. Initially, this isn't pos...