windows-services

XCopy or MOVE do not work when a WCF Service runs a batch File. Why?

廉价感情. 提交于 2019-12-05 04:13:00
I have faced a case when the same batch file works differently from command line and when it is fired from a WCF service hosted on IIS. The difference is in XCOPY command. when I am running the batch file normally than XCOPY moves all data I need XCOPY "C:\from" "C:\to" /K /R /E /I /S /C /H /G /X /Y but when it runs from the WCF service nothing is copied. for running the batch from my service I am using the following code Executing Batch File in C# whith some little modifications. My Application pull is running under LocalSystem account. I also tryed to use my own account for the application

Change Windows Service user programmatically

a 夏天 提交于 2019-12-05 04:00:37
I need to change Logon user for a Windows service programmatically. And I am using the following code to do that: string objPath = string.Format("Win32_Service.Name='{0}'", ServiceName); using (ManagementObject service = new ManagementObject(new ManagementPath(objPath))) { object[] wmiParams = new object[11]; if (PredefinedAccount) { wmiParams[6] = "LocalSystem"; wmiParams[7] = ""; } else { wmiParams[6] = ServiceUsername; // provided by user wmiParams[7] = ServicePassword; // provided by user } object invokeResult = service.InvokeMethod("Change", wmiParams); // handle invokeResult - no error

Is it possible to observe Rss feed change in C#?

五迷三道 提交于 2019-12-05 03:57:42
问题 I want to create a service that would listen to few Rss feeds and parse new feeds to jSon for further use. Is it possible to observe to feed changes and if yes then how? thanks 回答1: Check out the System.ServiceModel.Syndication.SyndicationFeed namespace in the framework - it has pretty much everything you need to download feeds. Scott Guthrie has a couple of good example blog posts about reading feeds here and here. 回答2: The only way to observe RSS feed changes is to poll the feed by

Windows Process Activation Service not starting - error 13

南楼画角 提交于 2019-12-05 03:39:13
I have IIS version 10 installed on Windows 10 Pro Version 1709, build 16299.125. After a Windows update, IIS stopped working. I saw that W3SVC isn't working, because WAS (Windows Process Activation Service) can't be started. When I try to start WAS, Windows display the message: Windows can't start Windows Process Aplication Service on Local Computer. Error 13: The data are invalid Looking at Windows Event Log, I see that WAS didn't started due event ID 5005, 5215 and Service Control Manager stopped due event ID 7023. I did some research and tried a lot of stuff: I tried the commands as

SVNserve giving Error 1053 The service did not respond to the start or control request

扶醉桌前 提交于 2019-12-05 03:03:48
问题 I have installed SlikSVN and I'm trying to set up svnserve. SlikSvn is installed in C:\Program Files\SlikSvn and C:\Program Files\SlikSvn\bin is in the path. The registry entry for the service is currently" svnserve.exe --service -r "C:\SVNReposities" DisplayName= "Subversion" depend= Tcpip start= auto However, when I try and start the service I get the following error: Could not start SVNService service on Local Computer Error 1053: The service did not respond to the start or control request

Windows Service w/ FileSystemWatcher in C#

喜夏-厌秋 提交于 2019-12-05 02:25:18
I have to create a program that monitors changes in file size. I already made a simple windows service and filesystemwatcher so I am now familiar w/ the concept. I also made a code that checks for the filesize (made it in a form button)but haven't yet implemented in my filesystemwatcher. How do I create a windows service that has a filewatcher that monitors the file size? Do I have to put a filesystemwatcher inside the windows service and call the watcher via the OnStart method? If you're making a Window's service, then you'll want to do it programmatically. I usually keep forms out of my

Timer within Thread within Windows Service

给你一囗甜甜゛ 提交于 2019-12-05 02:02:33
问题 I cant figure out how to proceed the best way with this problem. Right now I have a windows service which only task is to gather data from a database with a specific DSN and then send out an email if the data is valid. The service contains a timer which ticks every 5 minuts and performs the tasks above. Now I need to re-write the windows service to be able to run on more than 1 DSN. I was thinking of making several threads inside the windows service and then again have a seperat timer inside

Running msiexec from a service (Local System account)

余生颓废 提交于 2019-12-05 01:06:57
We are working on an update system for our software. The updater should run in the background as a service, and when an update is available, download and install it. We need the service to install the update since the MSI requires elevation to run, but some of our clients will be restricted users. The MSI is a WiX MSI and does a major upgrade when run. The problem is, the update does not seem to work when run from our service. I can see msiexec run, and it returns successfully, but it seems to make no changes to the system. The same command, when run from my user account works as expected. Is

How to determine if starting inside a windows service?

点点圈 提交于 2019-12-04 23:58:53
问题 Currently I'm checking it in the following way: if (Environment.UserInteractive) Application.Run(new ServiceControllerForm(service)); else ServiceBase.Run(windowsService); It helps debugging a little and service can also be run using the executable. But assume now that the service requires interaction with the user desktop so that I have to enable "Allow service to interact with desktop" in the properties. This of course breaks this way of checking. Is there another way? 回答1: It's not perfect

Unable to install windows service with the help of InstallUtil tool

我的未来我决定 提交于 2019-12-04 23:58:37
I use VS 2012 and since the setup projects have been removed from it I have to use InstallUtil.exe. I don't have projectInstaller class in my windows service app. I run in command prompt: installutil FilesMonitoringService.exe I get: C:\Program Files\Microsoft Visual Studio 8\VC#>installutil "C:\Program Files\Mic rosoft Visual Studio 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyServ ice.exe" Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. Running a transacted installation. Beginning the Install phase of