windows-services

Executable started by a windows service using the local system account cannot access network shares

I have an executable that is started by a windows service, this program will be run on a customers machine and will need to connect to a remote share to perform a particular task. This share is specified by the customer via a UI, so we do not know this in advance meaning it can't be "hard-coded", or the share mapped in advance. Previous...

Windows Service or SQL Job?

I have an archiving process that basically deletes archived records after a set number of days. Is it better to write a scheduled SQL job or a windows service to accomplish the deletion? The database is mssql2005. ...

How do I change the display name of a c++ windows service?

Where can I set the display name in the Service Control Manager of a c++ app? ...

Install a .NET windows service without InstallUtil.exe

I have a standard .NET windows service written in C#. Can it install itself without using InstallUtil? Should I use the service installer class? How should I use it? I want to be able to call the following: MyService.exe -install and it will have the same effect as calling: InstallUtil MyService.exe ...

Investigating which Windows service is listening to which IP and port

I am investigating a production system where there are several Windows services communicating with each other through TCP/IP sockets. I'm trying to figure out which executable is listening to which IP address and which port on a given machine. Other than rummaging through each windows service's obscure configuration files, is there a sy...

Assembly not referenced error in Windows Service

Hi, I am designing a windows service and now deploying it. I have the code: ServiceInstaller serviceInstaller1 = new ServiceInstaller(); This instantiates the object (obviously, but throws the following compile-time error: Error 1 The type 'System.Configuration.Install.ComponentInstaller' is defined in an assembly that is not refe...

Simplest way to restart service on a remote computer

What's the easiest programmatic way to restart a service on a remote computer? Language or method doesn't matter as long as it doesn't require human interaction. ...

How can a Windows service execute a GUI application?

I have written a Windows service that allows me to remotely run and stop applications. These applications are run using CreateProcess, and this works for me because most of them only perform backend processing. Recently, I need to run applications that present GUI to the current log in user. How do I code in C++ to allow my service to lo...

Delphi - Gracefully Closing Created Process in Service. (using tprocess / createProcess)

I have a Windows Service written in Delphi which runs a number of programs. On Stopping the service, I want to also close these programs. When the service was originally written, this worked fine, but I think I've updated the tProcess component and now - The subordinate programs are not being closed. in tProcess - Here's the code whi...

Best guide for creating Windows Services in C# .NET?

Hi, all. I'm looking to convert a small .NET console application into a Windows Service. I'd like to build two versions, one using .NET 2.0 and another with .NET 3.5 . Are there radically different approaches that need to be taken, or will the 2.0 version be roughly equivalent to the 3.5 version? Where's a good source of information ...

Confusion about installing windows service using command prompts

Hi, I have designed a simple windows service in .NET 2.0. I am trying to deploy it on my local machine. I have switched to design view, and setup ServiceInstaller and ServiceProcessInstaller objects. There is a Project Installer. I have also wrapped the Windows Service into a .NET setup project and install it, leaving an .exe in the sp...

Enabling/Disabling Aero from a Windows Service

I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service. The code works in a standalone application, but when I run it from a Service, nothing happens. No errors or exceptions are thrown. I realise that running code in a service is a different scope than running code in an ap...

"net use" command in a Windows Service

Hello to all, We're using the following command line from within a Windows Service developed with C# .Net Framework 1.1: net use z: \\myComputer\c$ The service is running under a domain account that is a local administrator on "myComputer". After debugging the code we can see that it does not return any errors but the "z:" drive is n...

Windows Service without the VS2005 template

Hi, I have the VS2005 standard edition and MS says this: Note: The Windows Service Application project templates and associated functionality are not available in the Standard Edition of Visual Basic and Visual C# .NET... Is it possible to write a Windows Service application without upgrading my VS2005 Standard edition? ...

How to return an error from a service?

I'm writing a service application that sometimes cannot be stopped immediately upon receiving the SERVICE_CONTROL_STOP from the Services MMC. I currently handle it like this: (in pseudo-code): DWORD HandlerEx( DWORD dwControl, DWORD dwEventType, PVOID pvEventData, PVOID pvContext ) { switch( dwControl ) { ...

How to monitor Windows services

I'm looking for a way to monitor certain Windows services (on Windows Server 2003) and restart if necessary. The services are on different servers and include mainly SQL Server services (e.g. SQL Server Agent), but also some proprietary services. Email alerts sent out if a service has stopped would be very useful as well. ...

Enable/disable windows-update from a vbscript

I need to disable windows-update service from my installation. I already use vbscript to do some stuff so I would like to do it in vbscript. My knowledge of vbscript (or any other script language) is very limited so...can anybody help me out with that? I'll really appreciate it! Thanks. ...

How can I find the location of exe that runs as a windows service in run-time?

How can I find the location of exe that runs as a windows service in run-time? ...

How to uninstall a windows service and delete its files without rebooting

My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to: (1) stop the service (2) uninstall the service (3) reboot the system (so Windows releases it's hold on the file) (4) deploy the new .exe (5) reinstall the ser...

Want to script Windows WMI (wmiprvse.exe) to release handle on file

I'm working with a VB Script file written by someone else that uses Windows Management Instrumentation (WMI) calls to check on the status of several Windows Services. This script runs every few minutes on set schedule. I need to upgrade/replace the .exe for those services. I stop the VB Script, stop the services, and uninstall the ser...