windows-services

How to make windows service application so it can run as a standalone program as well?

无人久伴 提交于 2019-12-03 07:20:18
问题 I'll start with an example: Apache web server (under Windows) has a nice feature: it can be both run as a standalone application (with current users privileges), and that it can be installed and run as a windows service directly (as local system account), using same executable. In order for application to be run as a standalone app, all it needs to do is along the lines of having static public Main() in some public class. In order for application to be installable and runnable as service, it

What are the differences between a web service and a Windows service?

∥☆過路亽.° 提交于 2019-12-03 06:59:44
问题 What are the differences between a web service and a Windows service? My experience has mostly been with Windows services, and I have never created a web service. Do web services behave similarly to Windows services? Can they have scheduling, run at certain times, etc.? When you would use a web service in place of a Windows service, and vice versa? 回答1: They're about as different as two things can be. A Windows service is an application that runs without a user being logged into the system,

How to launch a GUI program in a Windows service?

ⅰ亾dé卋堺 提交于 2019-12-03 06:57:43
When I run a service as LocalSystem account, I can use following codes to launch a GUI program under current login account: WTSGetActiveConsoleSessionId->WTSQueryUserToken->CreateProcessAsUser However, when I run the service as my personal account, the GUI program will NOT show up. I can see it in task manager though. What should I do to launch the GUI program when the service is running under my personal account? John and jdigital are both right - from my understanding, services can generally have either desktop access (you have to use localsystem) or network access (you need to specify an

Windows service - get current directory

自古美人都是妖i 提交于 2019-12-03 06:28:16
问题 I have a Windows service that should look for a configuration file in its current directory. So I use directory.getcurrentdirectiry() but instead of the service directory I get back c:\windows\system32 Any idea why and how should I get the service directory? 回答1: Don't use Directory.GetCurrentDirectory() . I had the same exact problem with C:\Windows\System32 being returned. Use this instead: Path.GetDirectoryName(Application.ExecutablePath); 回答2: You can set the current directory to the

Windows Service or SQL Job?

做~自己de王妃 提交于 2019-12-03 06:27:52
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. Update: To speak to some of the answers below, this question is regarding an in house application and not a distributed product. It depends on what you want to accomplish. Do you want to store the deleted archives somewhere? Log the changes? An SQL Job should perform better since it is run directly in the database, but it is easier to give a service acces to resources outside the

How to Create a C# Listener Service for MSMQ as a Windows Service

人盡茶涼 提交于 2019-12-03 06:22:26
I'll start by saying I'm not a .NET developer, but have been thrown into a project where I need to use MSMQ so a classic ASP web application can send messages to a C# Windows Service that handles the processing. I have experience integrating other message queues with other languages, but like I mentioned, I don't have much experience with .NET and Windows development so some guidance would be much appreciated. Here are my questions... Could someone provide some basic C# code that listens to an existing MSMQ queue and responds to the new message by doing something simple like writing the

Start And Stop Windows Service remotely using PSEXEC

可紊 提交于 2019-12-03 06:15:37
How to start and and stop a Windows service remotely using PSEXEC? Preferably the syntax to write I tried the cmdlet given below psexec \\Server -u Administrator -p Somepassword ServiceName I can't test this right now, but it ought to be: psexec \\server -u username -p password net start ArgusCommunityWorkerService and psexec \\server -u username -p password net stop ArgusCommunityWorkerService PSService on SysInternals is specifically for remotely controlling services::` psservice [\\computer [-u username] [-p password]] <command> <options> where: query Displays the status of a service.

Auto-update a Windows Service [closed]

大城市里の小女人 提交于 2019-12-03 06:07:56
I am about to develop a program which will be installed and run as a Windows Service on the back-end servers (with internet access) of several clients. I do not have physical access to the servers. What I am working on is a scheme for reliably rolling out updates to the program. I have spend quite a lot of time looking for best practices for Windows Service auto-updates, but have found very little useful information. Most techniques, such as ClickOnce, seem to cater primarily for Windows Forms-based applications. My current plan is: When updates are available, have the running service download

How configure log4net for a c# Windows service

家住魔仙堡 提交于 2019-12-03 06:01:28
问题 I have a windows service where the app.config file and the log4net.config files are seperate. The logging is not working. In my app.config file, I have the following in the section: <add key="log4net.Config" value="log4net.config"/> This works if in the value I specify an absolute path to the log4net.config file. Do I need to supply an absolute path to the log4net.cong? Both the log4net.config and app.config file are in the same folder as the executable. any ideas? Parag 回答1: Maybe this is

.Net Windows Services and InstallState file - is it really needed?

孤街醉人 提交于 2019-12-03 06:01:25
I've got a number of managed code Windows Services for which we use the Frameworks InstallUtil tool to install into the service control manager. This tool creates a new file at install time with an extension of .InstallState. I have experimented with deleting this file and an uninstall still works fine afterwards. So my questions is, what is this file for and is there any reason I shouldn't delete it? Edit 5/3/10: Really? Nobody has any clue what the value of this file is? In VS.NET you can define a custom dialog for your msi project, I am using such a dialog to ask for the SQL Server address