windows-services

C# - How to access a remote thread?

Hello, First I'm going to explain what I'm trying to do, before asking the question directly. Basically, there is a Windows Service running on a specific machine, let's call it M1. This Windows Service runs a set of tasks using threads (1 thread for each partition of tasks). I need to program a functionality that will let the user stop/...

Web service reference problem in Windows service

I have a Windows Service which runs a Web Service code in a library. The structure is like this: MyWindowsService.exe (references to MyServiceLibrary.dll) MyWindowsService.exe.config MyServiceLibrary.dll (references to web service) MyServiceLibrary.dll.config (contains endpoint information about the web service) The process is like th...

Run app from a service using CreateProcessAsUser

I'm still trying to run an app calling it from windows service. I tried to use the way described by Scott Allen. It works. But still I can't bring the app to the screen to interact with it. Help me pls. Even if I'm telling it to run the service using my credentials it doesn't bring the app on my desktop. tell me please how to get the cu...

How to pull a range of failed services from a remote server after a reboot

Caveat: Without spiking the cpu while a Get-WmiObject call parses the whole event log to match my specified filter. Situation: I am working on a script that remotely runs some checks, then reboots a pc. I want it to check the health once the server reboots (after sleeping for some time) to make sure services that were supposed to start ...

A simple data processor running on Amazon EC2

I'm a newbie to the all cloud computing business. I'm implementing a data process application running on a Windows server instance on Amazon EC2. The application would listening to a Amazon Simple Queue for new jobs. should I write a windows server that listens to Simple Queue for new messages, then spawn a process to process data? Kee...

ServiceController in a Windows Service

Hello, I'm trying to use ServiceController.GetServices() method to get the list of all the services. In a console application, it works OK, but I get an empty list if I call this method in a windows service. That seems an authentication issue, but I used all the account options ( Local System, Local Service, Network Service, User[which...

Windows service connects to a server to download some files

There are three serves on the same zone. 172..*.** Suppose that their names are A,B and C The server A has a windows service, and it downloads the files from the server of C, in the folder of images. It used to give errors about access-denied then we assign full control to everyone on the folder of images on the server C. Then it was ...

run a program from a windows service

I have a program which i want to invoke from windows service. xsftp.StartInfo = New ProcessStartInfo("c:\stage\psftp.exe", "[email protected] -b c:\stage\script.bat -pw XXX") xsftp.Start() The same code works fine if i write in a console application, but from windows service it wont run, i see the psftp is being started in the task man...

.Net Windows Service and Custom Trace Listeners

I have all of my service logic encapsulated in class library. When I instantiate the class library in a command line app I receive my trace information. When I instantiate the class in a Windows Service, I see that my Custom trace listener has created the logs directory and start a file, but it stays a 0 KB. Both applications have thi...

Start A Remote Service From C#

I'm using the following code in a C# WinForms app to start windows services on a remote PC public static List<Service> GetServices() { List<Service> Services = new List<Service>(); ServiceController[] sc = ServiceController.GetServices(Server); foreach (var s in sc) { Services.Add(new S...

AJAX Chat, implement server with DB or as a windows service?

I am implementing an AJAX chat. No worries there but I was thinking of how to implement the server side code. At the moment I write from a DB when a user sends and reads from the DB when a user requests his messages. I am thinking that this is not the most efficient way as I am writing and reading all the time. My plan was to implement...

How to do error handling in Windows .NET Services

This feels like a question that has probably been asked before but I couldn't find it so am asking (possibly again). I'm writing a windows service to do a bit of file monitoring and processing. Its all doing what I want but I am aware that there are several places that my code might throw errors when doing read/writes to the file system...

WiX service installer and custom install events...

I have an existing (C# based) windows service that is derived from the Installer class and I currently use the MS supplied, command line InstallUtil to install it and uninstall it. This works fine and as part of my system I have attached event handlers to the AfterUninstallEventHandler and CommittedEventHandler events. In my case I sim...

How to configure TopShelf to run a service as ServiceAccount.NetworkService?

How to configure TopShelf to run a service as ServiceAccount.NetworkService? http://code.google.com/p/topshelf/ ...

wmic via .NET or C#

All, Please forgive my ignorance of C#/.NET, I am absolutely new to both (mostly Java, C/C++) and find myself tasked with creating some code that performs the same thing as the "wmic qfe" and "wmic os" commands available at the DOS prompt. Can this be done? If so, any help is appreciated. I am trying to working my way through the Sys...

How to get rid of appname.vshost.exe file?

I have created a windows service following basically these instructions: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx I install it with my installer and my problem is that when I start it and then take a look at the task manager processes I can see not only appname.exe running but also appname.vshost.exe. Can someon...

Good Sample .Net Windows service to report an error

Hi all, I am writing a windows service that will be doing a lot of network communication (copy many many files in shared folders and modify database). I need a way to notify a user (if logged on) of any exceptions/errors. My issue is do group to errors for send it (by email) to administrator address. I am aware of event logging neithe...

Can a windows service and a IIS site share the same dlls?

Can a windows service and a IIS site share the same dlls? And maybe the configuration (web.config)? ...

Needed: A Windows Service That Executes Jobs from a Job Queue in a DB; Wanted: Example Code

Needed: A Windows Service That Executes Jobs from a Job Queue in a DB Wanted: Example Code, Guidance, or Best Practices for this type of Application Background: A user will click on an ashx link that will insert a row into the DB. I need my windows service to periodically poll for rows in this table, and it should execute a u...

C# Windows Service - Multiple timers

I'm developing a windows service that will need to do multiple tasks at different periods. I currently have two timers, a full timer and a stock timer running at different intervals defined like below. fullTimer = new System.Timers.Timer(); fullTimer.Elapsed += new ElapsedEventHandler(OnElapsedTime); fullTimer.Interval = Convert.ToD...