windows-services

Windows service couldnt get screenshot in windows 7

北城以北 提交于 2019-11-26 10:01:12
问题 I have a windows service which gets the screenshots. But its creating only black screens. I know this happens because of session 0 isolation. I searched on internet and couldnt find any approved solution for this problem any working ideas will be really good. 1- Is there a way to change the session of a windows service and get the desktop screen of another user\'s session like session 1, session 2? 2- Is there a way to start a console application which runs in an another session other than

How can I mount a windows drive in Java?

家住魔仙堡 提交于 2019-11-26 09:39:59
问题 We are working with some legacy code that accesses a shared drive by the letter (f:\\ for example). Using the UNC notation is not an option. Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly in the code. Has anyone done this? 回答1: Consider executing the DOS command that maps a network drive as in the following code: String command = "c:\\windows\\system32\\net.exe use f: \\\\machine\\share /user:user password"; Process p = Runtime

Start a windows service and launch cmd

梦想的初衷 提交于 2019-11-26 09:34:18
问题 Do I need to enable Interactive desktp for it to work and what is the correct code to start an EXE or cmd window? I\'m still unable to start the service even when I had enable it to interact with desktop. I would be using an chat engine so it is easier to manage as a windows service. What wrong with my code? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceProcess; using System.Diagnostics; using System.ComponentModel; using System

System.BadImageFormatException: Could not load file or assembly (from installutil.exe)

こ雲淡風輕ζ 提交于 2019-11-26 09:17:20
问题 I am trying to install a Windows service using InstallUtil.exe and am getting the error message System.BadImageFormatException: Could not load file or assembly \' {xxx.exe} \' or one of its dependencies. An attempt was made to load a program with an incorrect format. What gives? EDIT: (Not by OP) Full message extracted from dup getting way more hits [for googleability]: C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319>InstallUtil.exe C:\\xxx.exe Microsoft (R) .NET Framework Installation

Printing from a .NET Service [closed]

你说的曾经没有我的故事 提交于 2019-11-26 08:23:18
问题 I am working on a project right now that involves receiving a message from another application, formatting the contents of that message, and sending it to a printer. The technology of choice is C# windows service. The output could be called a report, I suppose, but a reporting engine is not necessary. A simple templating engine, like StringTemplate, or even XSLT outputting HTML would be fine. The problem I\'m having is finding a free way to print this kind of output from a service. Since it

System.Drawing in Windows or ASP.NET services

£可爱£侵袭症+ 提交于 2019-11-26 08:19:47
问题 According to MSDN, it is not a particularly good idea to use classes within the System.Drawing namespace in a Windows Service or ASP.NET Service. Now I am developing a class library which might need to access this particular namespace (for measuring fonts) but it cannot be guaranteed that the host process is not a service. Now there is a less optimal method I can fall back to if System.Drawing is unavailable, but if it is possible, I would rather use classes in System.Drawing. So what I would

How can I run a Windows GUI application on as a service?

﹥>﹥吖頭↗ 提交于 2019-11-26 08:16:57
问题 I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running. Is this even possible? EDIT: Further refinement here... I do not have the source, it\'s not my application. 回答1: Windows services cannot have GUIs, so you will need to either get rid of the GUI or separate your application into two pieces - a service with no UI, and a "controller"

Launching a process in user’s session from a service

我是研究僧i 提交于 2019-11-26 08:13:33
问题 In Windows Vista/7/2008/2008R2, is it at all possible to launch a process in a user\'s session from a service? Specifically, the local session would be most useful. Everything I\'ve been reading seems to say this isn\'t possible, but I figured I\'d ask here before giving up completely. I\'m coding in VB.NET, but will take suggestions in anything. 回答1: It is really possible. The main problem which you have is that Windows should be seen as a terminal server and a users session as a remote

How do I debug Windows services in Visual Studio?

给你一囗甜甜゛ 提交于 2019-11-26 08:01:55
问题 Is it possible to debug the Windows services in Visual Studio? I used code like System.Diagnostics.Debugger.Break(); but it is giving some code error like: I got two event error: eventID 4096 VsJITDebugger and \"The service did not respond to the start or control request in a timely fashion.\" 回答1: Use the following code in service OnStart method: System.Diagnostics.Debugger.Launch(); Choose the Visual Studio option from the pop up message. Note: To use it in only Debug mode, a #if DEBUG

What are the specific differences between .msi and setup.exe file?

旧街凉风 提交于 2019-11-26 07:55:28
问题 I searched a lot, but all are guessed answers. Help me to find the exact answer. 回答1: An MSI is a Windows Installer database. Windows Installer (a service installed with Windows) uses this to install software on your system (i.e. copy files, set registry values, etc...). A setup.exe may either be a bootstrapper or a non-msi installer. A non-msi installer will extract the installation resources from itself and manage their installation directly. A bootstrapper will contain an MSI instead of