windows-services

Find which account a service is set to “Log On As”

淺唱寂寞╮ 提交于 2019-12-04 03:14:58
问题 How to find out the user account (Local System/User etc) a service is set to run under ("Log On As")? Unlike this similar question this code can't run from within the service itself and the service may not be running. The System.ServiceProcess.ServiceController class has useful methods for getting the status but not the "Log On As" user. 回答1: This is the only way I know of, I found it looking around and tested it, it works. Make sure you use the Service Name not it's Display Name, you will

WiX: Old versions don't disappear in Add/Remove Programs list

烂漫一生 提交于 2019-12-04 02:54:20
I have a Windows Service that I install and upgrade with WiX, and this works great (it's very fast!). The only problem is that if I upgrade from, say, 1.0 to 1.1, both copies still have entries in the Add/Remove Programs list. So how can I make sure WiX removes its old/outdated entries in the Add/Remove Programs list when I perform an update? Create a major upgrade. For example, use the MajorUpgrade element in WiX v3.5. http://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/ An addendum to this - if the RemoveFeatures attribute of MajorUpgrade is included, and names specific

Windows Service is giving Description: <Failed to read description error code 2>

為{幸葍}努か 提交于 2019-12-04 02:42:48
I have tired to uninstall a disabled windows service through registry It is removed from registry but it is still showing in Services.msc with Description: Failed to read description error code 2 Intuition/How you got there - I am assuming you did either or both of these to land in this error message. a.Deleted the key manually from registry by HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and deleted the service from here) b.This service was in "automatic" start - so on deleting the service was somehow mislead in "starting automatically" - and hence produced this code Failed to read

how to identify logon event in window service

风流意气都作罢 提交于 2019-12-04 02:23:57
问题 i have a windows service that get user details and save the result into log text file. and, my problem is when i log off my system and login again ie without restarting the machine.., i also would like to save the time that i login my system into that log file.. How can write a login event in window service.. pls help with comments I have used the below code, but nothing was written to the log text file on log on. ie LogOn no-1 or LogOn no-2... Is there any mistake or logon didnt get enough

Restart a service with dependent services?

老子叫甜甜 提交于 2019-12-04 02:23:45
Starting with a csharp-example and duly noting related SO questions ( Restart a windows services from C# and Cannot restart a Service ) and various other questions relating to restarting just one service , I'm wondering what the best method is for restarting a service with dependent services (e.g. Message Queuing , on which Message Queuing Triggers depends, or IIS , on which FTP Publishing and World Wide Web Publishing depend). The mmc snap-in does this automagically, but the code doesn't seem to provide the same functionality (at least not as easily). MSDN documentation for Stop says "If any

Windows Service won't automatically start after reboot [duplicate]

眉间皱痕 提交于 2019-12-04 00:59:53
This question already has answers here : Closed 6 years ago . “A timeout was reached while waiting for the service to connect” error after rebooting (6 answers) My automatically starting windows service fails to start only on reboot. I have a windows service created in C# and installed via a Wix created installer. The service is set up to start automatically. The service is installed and run under the NT AUTHORITY\NETWORK SERVICE. When the service is started, it first makes an external web services call. In Windows 7 I can set the service to be Automatic - Delayed start and the service will

Cannot access excel file

最后都变了- 提交于 2019-12-04 00:20:49
问题 I'm developing a windows service, generating a report. This report has a template. This template is prepared in an excel file. This file is copied to the output folder. While developing I launched the service like a console application and had no problems accessing this file. Then I prepared a service installer. The service is installed under Local System account. So this excel template file is marked as content and copied to the installation directory together with the executable as well.

.net windows service local application data is different then in normal app

一世执手 提交于 2019-12-04 00:18:54
问题 In normal console app I have this Environment.SpecialFolder.LocalApplicationData is C:\Users\Simon\AppData\Local\ In Windows service Environment.SpecialFolder.LocalApplicationData is C:\Windows\system32\config\systemprofile\AppData\Local\ How can I specify same path in both type of application? 回答1: Remember that the services run under a different user profile (can be a LOCAL_SERVICE, NETWORK_SERVICE, etc.) If you'd like them to be the same, run the service under your user profile (You can

Using NSSM to start a NodeJs process as a windows service is not working

不羁的心 提交于 2019-12-04 00:16:19
I have seen countless articles on how to use NSSM ( http://nssm.cc/ ) to start a NodeJS process. So, I have the following simple NodeJS file: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end('<p>Hello World</p>'); }).listen(8000); console.log('Server running on http://localhost:8000/'); I am using this command to install the NodeJS file as a windows service: "C:\Program Files\SimpleNode\nssm.exe" install SimpleNode "C:\Program Files\SimpleNode\node.exe" "C:\Program Files\SimpleNode\simple.js" The service is

Windows could not start service on Win Server 2008 R2 SP1 (Error 1053)

一笑奈何 提交于 2019-12-04 00:07:41
This issue seems to be widely discussed, but I have problems with finding the solution in my particular case. My service is set up to be running under Local System account. On my first machine with Windows 7 SP1 (64-bit) installed, everything works as expected. But, just after I try to start the service on my second machine with Windows Server 2008 R2 SP1 (64-bit) , not even a second passes, and I'm facing this annoying error: Windows could not start the ProService service on Local Computer Error 1053: The service did not respond to the start or control request in a timely fashion The System