windows-services

Msi insaller passing paramenter from command prompt for Set Service Login

放肆的年华 提交于 2019-12-01 11:12:04
问题 Installer builder tool : Microsoft Visual Studio 2010 , Project Installer I am trying to pass username and password for the installer to use for running Windows services that will install by the installer. By default installer ask the Credentials during installation that i want to pass through command prompt. see attached pic I tried the solution that provided in the following issue. But still getting the "Set Service login" dialog during installation. msiexec /i setup.msi USERNAME

Windows Service - How to make task run at several specific times?

安稳与你 提交于 2019-12-01 11:08:04
I have a windows service running. Within it the task runs currently at 7pm every day. What is the best way to have it run say fir example at 9.45am, 11.45am, 2pm, 3.45pm, 5pm and 5.45pm. I know i can have scheduled task to run the function but i would like to know how to do this within my windows service. Current code below: private Timer _timer; private DateTime _lastRun = DateTime.Now; private static readonly log4net.ILog log = log4net.LogManager.GetLogger (System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); protected override void OnStart(string[] args) { // SmartImportService

How to schedule a C# Windows Service to run a method daily? [duplicate]

谁说我不能喝 提交于 2019-12-01 10:58:50
Possible Duplicate: How might I schedule a C# Windows Service to perform a task daily? I am creating a C# Windows Service, but I didn't figure out the best way to make timer fire a method daily at a specific time specified in App.Config file (e.g. daily at 6:00AM, my method is executed). How do you do it? Thanks This code should do it: Trigger tg = new DailyTrigger(); ScheduledTasks st = new ScheduledTasks(); Task t = st.OpenTask("foo"); t.Triggers.Add(tg); t.Save(); Create a scheduled task. It's by far the easiest way. If you've got enough access to install a service you should have enough

Printing from a Windows Service [duplicate]

北城以北 提交于 2019-12-01 10:45:58
This question already has an answer here: Printing from a .NET Service [closed] 11 answers How can I printing a document on a specific printer from a Windows-Service without the need of any user-interaction? A string, or a text-file. Maybe Crystalreport? Thanks. The point is not how to print from a windows service or from an application, if you don't want any user interaction to be required you have to specify all print parameters without any need to show a print dialog ( which you can't because a windows service has no access to the UI ). see here: http://msdn.microsoft.com/en-us/library

how to map network drive for Clearcase View in Windows service?

a 夏天 提交于 2019-12-01 10:38:15
I want to map a clearcase view on network drive inside a windows service. I have tried with net use command, but it did not work properly. You should be able to run the same kind of command than the one used when paths are too long , which is subst : subst X: c:\path\to\my\View # for snapshot view subst X: M:\myView # for dynamic view in order to map a view to a drive letter. This should work from within a service, provided: you are using your Windows account (and not the "Local System account") the dynamic view is already started (and visible in the M:\ MVFS mounting point drive) Garen I wish

Check Windows services status - what privilege do I need

ぐ巨炮叔叔 提交于 2019-12-01 10:35:44
I want to check some Windows services status on different remote servers like this: ServiceController sc = new ServiceController("MyWindowsService", "COMPUTER_NAME"); var status = sc.Status But I don't (and can't) have Administrator privileges on those servers. What right should I be asking for to check the status ? I don't wanna be able to restart them either, I need Read access only, The application isn't running on the same machine. Non-admin users can connect to the Service Control Manager remotely, provided they have the "Access this computer from the network" user right. By default this

Setting a thread priority in a service has no effect [closed]

别说谁变了你拦得住时间么 提交于 2019-12-01 09:40:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Is there some additional configuration needed before I can set thread priorities in a Windows service? In my service, I have a few threads that each call the CreateProcess() function to launch an external application. I would like to adjust thread (or process) priorities to normal or lower , depending on some

debugging window service

牧云@^-^@ 提交于 2019-12-01 09:18:15
问题 I want to debug window service. What should i write in main() to enable debugging in window service. I am developing window service using C#. #if(DEBUG) System.Diagnostics.Debugger.Break(); this.OnStart(null); System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite); #else ServiceBase.Run(this); #endif i wrote above code segment but on line (this 回答1: I would do it like this: In your service's OnStart method add the call to Debugger.Break() at the top: protected override void OnStart

Install and Run Windows Service in C++

倖福魔咒の 提交于 2019-12-01 08:49:47
问题 I am working on windows services for the first time and after some effort I am now able to Install and unistall a service programatically in C++, I have found many tutorials which guide on how to deal with ServiceMain and ServiceControlHandler functions. Problem is that there is no tutorial which shows that first we install a service and then in the same program apply ServiceMain and ServiceControlHandler functions. In short I am trying to integrate both functionalities in the same code but

How to schedule a C# Windows Service to run a method daily? [duplicate]

爷,独闯天下 提交于 2019-12-01 08:42:12
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: How might I schedule a C# Windows Service to perform a task daily? I am creating a C# Windows Service, but I didn't figure out the best way to make timer fire a method daily at a specific time specified in App.Config file (e.g. daily at 6:00AM, my method is executed). How do you do it? Thanks 回答1: This code should do it: Trigger tg = new DailyTrigger(); ScheduledTasks st = new ScheduledTasks(); Task t = st