windows-services

Automating Office via Windows Service on Server 2008

穿精又带淫゛_ 提交于 2019-11-26 05:33:11
问题 We have a Windows Service which runs on 2003 Server. It opens a source Word document using the Word Interop and then does some stuff with it. It also does likewise with Excel and PowerPoint files. Recently we\'ve tried moving this service onto a Windows 2008 Server machine and are having real problems with it. COMException at Microsoft.Office.Interop.Excel.Workbooks.Open COMException at Microsoft.Office.Interop.Word.Documents.Open I get the above exceptions when the windows service is running

GUI and windows service communication

别来无恙 提交于 2019-11-26 05:29:24
问题 I know since Vista, that C# can\'t hook a UI form directly to the windows service. This was stated on the Microsoft Site. My question in this regard is: \"What is the best mode of communication from a UI to the service?\" I have heard of Remoting, Web services, and direct TCP. Are there other methods? How do they rank against the previously mentioned methods? How complicated are they to implement? My application is for intranet use, not internet. Microsoft platform will be on both sides, so

How to make a call to my WCF service asynchronous?

限于喜欢 提交于 2019-11-26 05:27:29
问题 I have a WCF service that I call from a windows service. The WCF service runs a SSIS package, and that package can take a while to complete and I don\'t want my windows service to have to wait around for it to finish. How can I make my WCF service call asynchronous? (or is it asynchronous by default?) 回答1: All your needs will be satisfied in the following articles from MSDN: Implementing an Async Service Operation Calling WCF Service Async Designing Service Contracts 回答2: On Visual Studio

Windows Service to run constantly

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 04:34:20
问题 I\'ve created a Windows Service called ProxyMonitor and I\'m currently at the stage where the service is installs and uninstall\'s the way I want it. So I execute the application like so: C:\\\\Windows\\\\Vendor\\\\ProxyMonitor.exe /install Pretty self explanatory, and then I got to services.msc and and start the service, but when I do this I get the following message: The Proxy Monitor Service on Local Computer started and then stopped. Some services stop automatically if there is no work to

When creating a service with sc.exe how to pass in context parameters?

大兔子大兔子 提交于 2019-11-26 04:32:01
问题 When creating Windows service using: sc create ServiceName binPath= \"the path\" how can arguments be passed to the Installer class\'s Context.Parameters collection? My reading of the sc.exe documentation is that such arguments could only be passed on the end of binPath , but I have not found an example or been able to successfully do this. 回答1: sc create <servicename> binpath= "<pathtobinaryexecutable>" [option1] [option2] [optionN] The trick is to leave a space after the = in your create

How do you run CMD.exe under the Local System Account?

半城伤御伤魂 提交于 2019-11-26 04:30:43
问题 I\'m currently running Vista and I would like to manually complete the same operations as my Windows Service. Since the Windows Service is running under the Local System Account, I would like to emulate this same behavior. Basically, I would like to run CMD.EXE under the Local System Account. I found information online which suggests lauching the CMD.exe using the DOS Task Scheduler AT command, but I received a Vista warning that \"due to security enhancements, this task will run at the time

Inno Setup for Windows service?

冷暖自知 提交于 2019-11-26 04:29:25
问题 I have a .Net Windows service. I want to create an installer to install that windows service. Basically, it has to do the following: Pack installutil.exe (Is it required?) Run installutil.exe MyService.exe Start MyService Also, I want to provide an uninstaller which runs the following command: installutil.exe /u MyService.exe How to do these using Inno Setup? 回答1: You don't need installutil.exe and probably you don't even have rights to redistribute it. Here is the way I'm doing it in my

How do I get the currently-logged username from a Windows service in .NET?

淺唱寂寞╮ 提交于 2019-11-26 04:18:47
问题 I have a Windows service which need the currently logged username. I tried System.Environment.UserName , Windows identity and Windows form authentication, but all are returning \" System \" as the user as my service is running in system privileged. Is there a way to get the currently logged in username without changing my service account type? 回答1: This is a WMI query to get the user name: ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT UserName FROM Win32

.NET console application as Windows service

旧巷老猫 提交于 2019-11-26 03:47:41
问题 I have console application and would like to run it as Windows service. VS2010 has project template which allow to attach console project and build Windows service. I would like to not add separated service project and if possible integrate service code into console application to keep console application as one project which could run as console application or as windows service if run for example from command line using switches. Maybe someone could suggest class library or code snippet

How can I run MongoDB as a Windows service?

江枫思渺然 提交于 2019-11-26 03:46:52
问题 How can I set up MongoDB so it can run as a Windows service? 回答1: I think if you run it with the --install command line switch, it installs it as a Windows Service. mongod --install It might be worth reading this thread first though. There seems to be some problems with relative/absolute paths when the relevant registry key gets written. 回答2: After trying for several hours, I finally did it. Make sure that you added the <MONGODB_PATH>\bin directory to the system variable PATH First I executed