windows-services

Windows Service not appearing in services list after install

佐手、 提交于 2019-11-27 06:19:08
I've created a windows service in c#, using Visual Studio 2008 I pretty much followed this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx I created a setup project, as instructed to in the article, and ran it... it installs my service to c:\program files\product etc.... however, it does not then appear in the services list.. What am i missing? The most important part of the article you linked, is here To add a custom action to the setup project 1.In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears. 2

How do I restart a service on a remote machine in Windows? [closed]

痞子三分冷 提交于 2019-11-27 06:13:15
Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine? You can use the services console, clicking on the left hand side and then selecting the "Connect to another computer" option in the Action menu. If you wish to use the command line only, you can use sc \\machine stop <service> You can use mmc: Start / Run. Type "mmc". File / Add/Remove Snap-in... Click "Add..." Find "Services" and click "Add" Select "Another computer:" and type the host name / IP address of the

How to check if a service is running via batch file and start it, if it is not running?

白昼怎懂夜的黑 提交于 2019-11-27 06:02:54
I want to write a batch file that performs the following operations: Check if a service is running If is it running, quit the batch If it is not running, start the service The code samples I googled so far turned out not to be working, so I decided not to post them. Starting a service is done by: net start "SERVICENAME" How can I check if a service is running, and how to make an if statement in a batchfile? I'm a bit confused. What is the argument I have to pass onto the net start? The service name or its display name? lc. To check a service's state, use sc query <SERVICE_NAME> . For if blocks

Modifying the “Path to executable” of a windows service

蓝咒 提交于 2019-11-27 05:56:26
I'd like to modify the path to my application, but doing so breaks it because the service still points to the old location. By going to Administrative Tools > Services you can open a properties dialog and view the Path to executable , but there is no way to change it. Is there any way a user can modify the service path without having to reinstall the application ? Niall Connaughton There is also this approach seen on SuperUser which uses the sc command line instead of modifying the registry: sc config <service name> binPath= <binary path> Note: the space after binPath= is important. You can

How to Read Custom XML from the app.config?

霸气de小男生 提交于 2019-11-27 05:47:46
问题 I want to read the custom XML section from the app.config of a C# windows service. How do I go about it? The XML is below: <Books> <Book name="name1" title="title1"/> <Book name="name2" title="title2"/> </Books> 回答1: What you want to do is read up on Custom Configuration Sections. 回答2: In a project I developed I use something similar for configuration that I found. I believe the article was called the last configuration section handler I'll ever need (I can't find a working link, maybe

How do I eliminate “The specified service already exists” when I install new versions of my software?

萝らか妹 提交于 2019-11-27 05:43:10
问题 I have a VS2008 application that includes a service project (I'll call it ServiceProject). I have the installation project (InstallationProject) set to RemovePreviousVersions. Additionally, I have Custom Actions set for InstallationProject, to Install, Commit, Rollback, and Uninstall the Primary output from ServiceProject. Sometimes when I build new versions of the installer, I can install without an error. Often, when I get to the point of setting up the service (entering a username and

Is there any way to start a GUI application from a windows service on Windows 7?

我的梦境 提交于 2019-11-27 05:19:34
I have done a lot of searching to find a way to start a GUI application from a windows service on Windows 7. Most of what I have found is that with Windows 7 services now run in a separate user session and can not display any graphical interface to the current user. I'm wondering is there is any kind of workaround or different way of accomplishing something like this? Can the service start a process in a different user session? David Heffernan This change was made for a reason and not simply to annoy developers. The correct approach is to put your UI in a different program and communicate with

Windows Service to run a function at specified time

一笑奈何 提交于 2019-11-27 05:17:09
问题 I wanted to start a Windows service to run a function everyday at specific time. What method i should consider to implement this? Timer or using threads? 回答1: (1) On first start, Set _timer.Interval to the amount of milliseconds between the service start and schedule time. This sample set schedule time to 7:00 a.m. as _scheduleTime = DateTime.Today.AddDays(1).AddHours(7); (2) On Timer_Elapsed, reset _timer.Interval to 24 hours (in milliseconds) if current interval is not 24 hours. System

Creating a user interface for monitoring and interacting with a running windows service

ε祈祈猫儿з 提交于 2019-11-27 05:09:26
问题 I need to run a bunch of pluggable processes in a windows service on my server and want to create a user interface that allows me to interact with each of the plugins in use by the service. What is the most common method (or methods) for communication between a user interface and a long-running windows service? I am thinking of providing a go-between location such as a database and using some sort of messaging queue to issue commands to the service. Have any of you implemented such an

Trying to add a service reference results in Bad Request (400) in one project, otherwise runs fine

江枫思渺然 提交于 2019-11-27 04:56:54
问题 I'm in a delicate situation: As the title suggests, I can't seem to connect to a WCF service I wrapped up in a Windows Service. I followed the tutorial http://msdn.microsoft.com/en-us/library/ms733069%28v=vs.110%29.aspx every step and got it to work multiple times in this exact way, just not for one particular project. I really don't know what it is, I have a very simple interface with just one method as contract, my service is installed just fine and also starts just fine. Once I try to add