windows-services

Clientname is not set after a process is created with CreateProcessAsUser and CreateEnvironmentBlock

主宰稳场 提交于 2019-12-22 18:15:50
问题 I have written a C# service running under the local system account. I use it to spawn a process when a user logs in on a Terminalserver. The service implements the OnSessionChange method and receives SessionChangeDescription messages with the corresponding SessionID. I use this SessionID to get an access token from the user with WTSQueryUserToken . I convert this token into a primary token and pass it to CreateEnvironmentBlock to retrieve a pointer to the users environment variables. After

how to access romote windows service with Related ObjectQuery

倾然丶 夕夏残阳落幕 提交于 2019-12-22 17:39:55
问题 I want to control (start and stop) a windows service which is in the remote machine. I can connect that machine but I can't access to windows service. Here is my code. Can you help me? ConnectionOptions oConn = new ConnectionOptions(); oConn.Username = "****"; oConn.Password = "****"; ManagementScope managementScope = new ManagementScope(@"\\***.***.***.***\root\CIMV2", oConn); managementScope.Connect(); RelatedObjectQuery roq = new RelatedObjectQuery("Win32_Service.Name='KanAktarim'");

Dotnet Windows service setting up Recovery option using Managed code

孤人 提交于 2019-12-22 17:09:10
问题 I'm having a windows service which is developed using .net framework 4.6.1. While installing the service, I want to Programmatically set the Recovery option of the service. Is there any option using managed code to do this activity. 回答1: I got a tool call Topshelf (http://topshelf-project.com/ ) Which is helping me to set Recovery option programmatically. Just answering my own question. It will be helpful for others. 来源: https://stackoverflow.com/questions/45895691/dotnet-windows-service

How to install redistributable package of .NET Framework with Wix?

て烟熏妆下的殇ゞ 提交于 2019-12-22 13:55:18
问题 I have a general task: install .NET Framework 3.5 during the setup of my product. I do the following: I have created a custom action X Custom action X starts an executable Y via Process.Start() Executable Y kills the msiexec process and run .NET Framework setup package Here appear some problems: .NET Framework setup says that Windows Installer Service is not accessible and asks to terminate all another installations! I think, the cause of it is that Process.Kill() method terminate the process

How can I respond to a change in status for a Windows Service?

假装没事ソ 提交于 2019-12-22 10:59:56
问题 I wonder if there is any possible way to get or create an event for a status changed of a Windows Service. I know that the ServiceController class does not have the event, but it has the status. Is there any way that I can listen to an event? 回答1: This is exactly what the NotifyServiceStatusChange function is intended for. The docs say that it: Enables an application to receive notification when the specified service is created or deleted or when its status changes. I'm not sure if there's an

Writing a Scheduled Windows Service in .NET

孤街浪徒 提交于 2019-12-22 10:50:00
问题 I want to write a windows service which the user can schedule. i.e, the user can choose to run the service from 9:00 AM to 6 PM daily, or he could run it every night, starting from night 12 o clock at night to next day morning 6, etc. Is there any out of the box .NET API that will help me do this? I know I can do this using the Scheduled tasks, but is there any way to do this programmatically? 回答1: My first response is to question why a service? But more importantly, the question would be why

Windows Service + Windows Forms application. One database. Advice on concurrency

眉间皱痕 提交于 2019-12-22 10:45:14
问题 I have SQL Server database with information for files - I'm talking about custom properties. These are categories and description for each file. The Windows Forms application is for the user. But I will also make a Windows Service that will track any changes with the files. If a change happens(renamed,moved,deleted) the service has to update that same database accordingly. And I think it should do it right away, without any delay. Now this is going to be my first time making WS plus the first

MicrosoftWebDriver fails when constructing while running under TeamCity agent's windows service

拟墨画扇 提交于 2019-12-22 09:15:28
问题 Using: * Windows 10 Pro * MicrosoftWebDriver Release 14393 I'm having troubles with running my UI tests suite with Edge (while Chrome, Firefox and IE11 - all work). The problem does not occur while running in standard, windows - development environment. The problem only occurs when trying to run these UI tests on CI (TeamCity) agent. The agent is configured to run as a Windows Service. Firstly, when account running the agent service was given Administrator's account, I was being received the:

Python application using Twisted stops running after user logs off of Windows XP

妖精的绣舞 提交于 2019-12-22 08:22:39
问题 I inherited a project using the Twisted Python library. The application is terminating after the user logs off of Windows XP. The Python code has been converted to an executable using bbfreeze. In addition, the bbfreeze generated executable is registered as a Windows service using the instsrv.exe and srvany.exe. I've taken a simple chat example from the Twisted website and create an executable from bbfreeze and registered it with instsrv and srvany and the same problem occurs: the executable

Communication between different C# based services

跟風遠走 提交于 2019-12-22 08:06:44
问题 Is there a way to communicate between two different services? I have a service that already runs. Is there a way to create a second service that can attach to the first service and send and receive dates to it? I would also like to access the Windows service from a console application and attach to it. Is it possible? 回答1: To begin with I would play around with tcpclient and tcpserver http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx http://msdn.microsoft.com/en-us