windows-services

Windows Service startup time

天大地大妈咪最大 提交于 2019-12-24 21:43:41
问题 Is there a way to programmatically retrieve start-up time/duration for all the Windows Services that have started during boot in Windows XP? That is, the time the service was initialized to getting to the "started" state. Thank you in advance! P.S. I'm not asking for software recommendation. 回答1: I would start with looking at the logs in event viewer, check if that information you want is there. If it is, then use Microsofts EventLog class to get the log you want. For example if you're

IIS starting Issue“Process W3SVC can't be started on this computer . ” - cant remove Windows components?

不想你离开。 提交于 2019-12-24 21:17:16
问题 I have some strange behaviour trying to starting my IIS 10. infos about services: W3C Protokollierungsdienst -> runs, stops after a while WWW Publishingservice -> cant be started (see screenshot) wwwservicefailscreenshot Windows Acitvation Service -> cant be started (see screenshot) wasservicefailscreenshot on IIS i get the following error if i try to start it: iisstartingscreenshot i have tried to uninstall all the relevant IIS components over the Windows Feature Panel. uninstalled it,

Diffrence between windows services running own processes vs shared process

一曲冷凌霜 提交于 2019-12-24 19:26:08
问题 I am working on project where we have decided to split our background tasks (network, CPU and IO intensive) into three windows services. Now the question is, whether we should host all three services into a single process or create three independent services with their own processes. Windows Service project template allows multiple services to be created, when installed they'll create separate entries in Service Control Manager (SCM) and can be controlled independently. The benefit here is

Always Encrypted Feature - Failed to decrypt column. Call from Windows-Service App

只谈情不闲聊 提交于 2019-12-24 19:19:19
问题 .NET Framework Ver = 4.6.2 , Database = SQL Server 2016 App Type = Windows Service We are working on the "Always Encrypted" feature in the SQL 2016 db to perform the encryption on certain customer data columns. Our web application is built in the ASP.NET MVC architecture and is working fine with this new feature. We have copied and imported the certificate from the database server over to the IIS web-server. And the web-application is working smoothly. But when we try to access the DB from a

FileSystemWatcher OnError is not working from Windows service

拥有回忆 提交于 2019-12-24 18:44:59
问题 I have a FileSystemWatcher object in a Windows service. I wrote it in a console application using that app as a stub for my component. My component instantiates the FileSystemWatcher and sets up to watch a mapped drive. This works great for me from both the test stub Console App and the Deployable Windows Service. I also have the onError event hooked up with log4net logging a FATAL level error: public FileSystemWatcher CreateFileWatcher() { FileSystemWatcher watcher = new FileSystemWatcher();

InternetGetConnectedState and “it should not be used from a service” statement from MSDN

落爺英雄遲暮 提交于 2019-12-24 18:25:42
问题 I'm programming a Windows local service using C++ and WinAPIs. From within that service I need to know that an Internet connection is available (in general) so I came up with the InternetGetConnectedState API but then after reading the MSDN I found this in the Remarks section: In addition, it should not be used from a service. Well, "thank you", Microsoft! Does anyone have any idea why and what alternative can I use from a service. PS. I don't want to use the ping approach because obviously

python: execute command in Windows-Service

こ雲淡風輕ζ 提交于 2019-12-24 17:27:19
问题 I am working on Windows-service written in Python. I'd like to notify user about something, since it seems it cannot be done in service itself I've compiled small program tip.exe, that pops task-bar notifications. Usage is: path/to/tip.exe "title" "notification text" If I use it manully in cmd it works, but all my attempts: command='"{}" "{}" "{}"'.format(balloon_exe, title, message) result=subprocess.Popen(command, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE ) output, errors =

How to Start Windows Service As Administrator Privileges

拈花ヽ惹草 提交于 2019-12-24 17:01:44
问题 I have my own application server which is windows service who communicates with the sql server, in some cases sql server service is stop so I am stating that via this code ServiceController sc = new ServiceController("MSSQL$SQLEXPRESS"); sc.Start(); sc.WaitForStatus(ServiceControllerStatus.Running); but it requires administrator privileges to start service how can I start my window service as administrator 回答1: i just add this tag in my app.manifest file <requestedExecutionLevel level=

How to restart windows service?

别等时光非礼了梦想. 提交于 2019-12-24 16:08:03
问题 I got a snippet from http://www.csharp-examples.net/restart-windows-service/ to restart windows service, but i am not sure as to where to place the code? I need to restart windows service after my it is installed in my application. Thanks! EDITED private void ProjectInstaller_OnAfterInstall(object sender, InstallEventArgs e) { //base.OnAfterInstall(e); ServiceController sc = new ServiceController("MyServiceName", Environment.MachineName); sc.Start(); System.Threading.Thread.Sleep(3000); sc

Nofity User some message from a windows service

倾然丶 夕夏残阳落幕 提交于 2019-12-24 14:54:19
问题 I have created a windows service which gets soem info from database and I want to notify user based on the info retreived from the DB. How can I notify user from a windows service using system tray notification? Can you please show me some sample (using IPC mechanism) to get the return value of a method used in a windows service in a system tray notification? Thanks in advance. 回答1: There are several options such as these: Sockets : (Not too difficult to write, has firewall problems) You can