windows-services

Creating a Windows Service to open a program- Delphi

谁都会走 提交于 2019-12-03 13:34:23
问题 I'm creating a Windows Service with Delphi. What my service needs to do is basically open a program. In my code I'm using WinExec(aux,SW_SHOWNORMAL); . When I start and run the service nothing appears to be done, but when I look in TaskManager the program that my service should open is in the list and in the Username Column appears SYSTEM. So the program is opening but it doesn't show in the screen. I did a research in Google and found some functions like CreateProcess but I don't know how to

Check for environment variable in another process?

守給你的承諾、 提交于 2019-12-03 13:24:46
问题 In Windows, is there a way to check for the existence of an environment variable for another process? Just need to check existence, not necessarily get value. I need to do this from code. 回答1: If you know the virtual address at which the environment is stored, you can use OpenProcess and ReadProcessMemory to read the environment out of the other process. However, to find the virtual address, you'll need to poke around in the Thread Information Block of one of the process' threads. To get that

Service will not start: error 1067: the process terminated unexpectedly

廉价感情. 提交于 2019-12-03 13:07:59
问题 We have a custom service that we install with our application. The only problem is that after it is installed, it will not start, generating the error above. I have tried to diagnose what the problem is, but can't seem to find any useful information as to why it is quitting. I have tried the same service on a non "R2" 2008 server, and manual it worked fine. service simple java file running using batch file. Deamon service. Has anyone had any experience troubleshooting this type of problem,

Shared configuration files in .NET

我们两清 提交于 2019-12-03 12:47:52
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 have a shared configuration files for both of the applications within the solution. Is there a problem for the web application if the configuration isn't at the root level of the web application? Are there limitations here? Will I loose caching and automatic

What exactly is CPU Time in task manager?

别等时光非礼了梦想. 提交于 2019-12-03 12:45:21
问题 I have some WCF services that are hosted in a windows service. Yesterday I looked at Task Manager and noticed that the CPU time for my windows service process was over 5 hours, while the majority of all other processes were at 0. What does that mean? Should I be concerned that the CPU Time was 5+ hours? 回答1: CPU time is an indication of how much processing time that the process has used since the process has started (in Windows: link to a Technet article.) It is basically calculated by: CPU

all python windows service can not start{error 1053}

南楼画角 提交于 2019-12-03 12:42:39
all python code service can install but cannot start Error 1053: The service did not respond to the start or control request in a timely fashion". since my service can install and start in my server . i think my code has no problem. but i still wonder is there a solution that i can solve this error in code my service: import win32serviceutil import win32service import win32event import time import traceback import os import ConfigParser import time import traceback import os import utils_func from memcache_synchronizer import * class MyService(win32serviceutil.ServiceFramework): """Windows

SetThreadExecutionState is not working when called from windows service

爷,独闯天下 提交于 2019-12-03 12:40:30
I want prevent system from going to sleep/hibernate from a windows service. I am calling SetThreadExecutionState function to do that. But it seems to have no effect. I just want to know whether the function SetThreadExecutionState will for windows services. If not what will be the alternative ways to that. Below is the C# code i am using. I am calling it on Onstart method of service. [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern uint SetThreadExecutionState(EXECUTION_STATE esFlags); private void KeepAlive() { SetThreadExecutionState(EXECUTION_STATE.ES

How to change java_opts for tomcat when we run it as a windows service manually?

末鹿安然 提交于 2019-12-03 12:20:00
问题 I'm manually running tomcat 6 as a windows service on the console. I need to change java_opts before starting it. How do I do that? Also, Is there a way I can see the logs dynamically? 回答1: To alter the $JAVA_OPTS , you will probably need to edit the batch file you use to start Tomcat. I don't run Tomcat on Windows, but the $JAVA_OPTS appears in my catalina.sh inside the bin/ directory on my Linux installation. As far as viewing logs dynamically on Windows, there are a couple of options I'm

Does one need to manually create a Windows event log source when installing a Windows service

时光总嘲笑我的痴心妄想 提交于 2019-12-03 12:03:17
问题 I have developed a Windows service in C#. I have created a installer with Visual Studio 2008, which installs the Windows service. Everything is good so far. I want to make sure that the event source has been created at install time, so that any error/exception conditions at runtime are correctly logged to the Windows event log. Does the event source get automatically created (and removed) as part of the windows service installation (and uninstallation), or do I have to handle this myself and

Fire timer_elapsed immediately from OnStart in windows service

∥☆過路亽.° 提交于 2019-12-03 11:47:16
I'm using a System.Timers.Timer and I've got code like the following in my OnStart method in a c# windows service. timer = new Timer(); timer.Elapsed += timer_Elapsed; timer.Enabled = true; timer.Interval = 3600000; timer.Start(); This causes the code in timer_Elapsed to be executed every hour starting from an hour after I start the service. Is there any way to get it to execute at the point at which I start the service and then every hour subsequently? The method called by timer_Elapsed takes too long to run to call it directly from OnStart . Just start a threadpool thread to call the worker