windows-services

how to run php script from batch file

十年热恋 提交于 2019-12-08 13:58:06
问题 I have used this article php script which named upload_.php and i have successfully developed a windows service in C# which is running fine. Now in theory the service will run every hour and execute a batch file (task.bat). if i run the upload_php file directly it works fine now i think the problem is in task.bat file. here is my code Task.bat Code @echo off cd\ set path=C:\xampp\php; cd "C:\xampp\htdocs" php import.php exit When service runs it execute task.bat file but php script dont

How do you pass user credentials from one process to another for Impersonation in .NET 1.1?

巧了我就是萌 提交于 2019-12-08 13:54:17
问题 I have a Windows Service (written in .NET 1.1) running under a specific user account and instances of the service running on several servers. I would like to pass user credentials (username, password, domain) to the service from a WinForms application and have the service read/write files in the server's local file system impersonating the passed-in credentials. Is it better to pass the username, domain, and password and have the Windows Service perform the Impersonation? I don't see how to

Permission differences between windows service and console application

此生再无相见时 提交于 2019-12-08 12:39:29
问题 I'm developing an application with a smart card involved (digital signature). Let's assume that we have the same code in this two contexts: Console application, executed by Administrator user Windows Service, executed by Administrator user I suposed that if this two codes were executed by the same user they would have the same privileges. It seems that this is not true. When I try with the Windows Service (Executed with Administrator user) i receive TargetInvocationException

socket server listening all the time

送分小仙女□ 提交于 2019-12-08 12:11:40
问题 The requirement is server socket should accept the client socket connection all the time (windows service application). Below is the code which works fine for several hours, but after sometime accept does not work at all. To keep the accept all the time, I also have thread which connects the server every 10 min. By this way I got to know that server socket has stopped after some time (several hours) public void StartReceiveNotification() { if (!isStarted) { try { byte[] bytes = new Byte[1024]

Communication between WMI and Windows services

旧巷老猫 提交于 2019-12-08 11:59:53
问题 I have created a WMI application(in C++) which query what type of OS is there in the remote system. I used the following reference : http://msdn.microsoft.com/en-us/library/aa390422%28v=vs.85%29.aspx I have created a Windows Service(in C++) on the remote PC. Now I wont to connect my WMI application to the Windows services. I have read about the WMI Provides but I am not actually understanding how to use them to create my WMI classes :(. Can anyone provide me any information on how to proceed

C# InstallUtil/ManagedInstallerClass: Why are key value pairs not pass into the installers context parameters collection?

旧街凉风 提交于 2019-12-08 11:52:10
问题 I pass the service name into the argument list, but when I look in the installers context it is not there: args = new[] { Assembly.GetExecutingAssembly().Location, "/ServiceName=WinService1" }; ManagedInstallerClass.InstallHelper(args); Why are key value pairs not pass into the installers context? public override void Install(IDictionary stateSaver) { foreach (var param in Context.Parameters) { // ServiceName is not available in the Parameters collection } } 回答1: This is quite old thread, but

What are the access restrictions on accessing a DSN

风流意气都作罢 提交于 2019-12-08 11:50:07
问题 We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. access a system DSN unless the account that is running the service has admin privileges. (I get an Access Denied error, when trying to connect) 2. access a user DSN that was created by a different user (this one is understandable)

disable specific usb disk in windows service

你。 提交于 2019-12-08 11:20:58
问题 Does anyone know how can I prevent a specific USB disk/flash from installing in a Windows Service? I don't want to disable all usb ports, I just prevent a specific usb disk from installing. I'm using windows 7. 回答1: Yes, is possible disable USB disk, using Kernel-Mode Filter Driver . http://msdn.microsoft.com/en-us/library/windows/hardware/ff545890%28v=vs.85%29.aspx Few years ago, I wrote project, that accept only USB disks with specified VID\PID . Unfortunately, I can not find this project.

Create a Windows Service from within Java

天涯浪子 提交于 2019-12-08 11:17:06
问题 I have a Java program and I need to create a Windows Service from within that Java program. I want to basically run the command line sc create \"" + serviceName + "\" binPath= \"" + batFile + "\" start= auto However, when I run this process from within Java I get an error [SC] OpenSCManager FAILED 5: Access is denied. This command works fine if the user is an administrator, however my users of this Java program will not be administrators. How do I create a Windows Service from within Java (or

Running batch script as windows service

ぐ巨炮叔叔 提交于 2019-12-08 10:54:27
We have a java application which run as server running on a remote windows system which is started though a batch script which includes some initialization configurations. To avoid login into the system every time and starting / stopping the service I planned to add that batch script as a "Windows Service" and use it remotely through command prompt. After number of failed attempts I came to know there is no simple way of doing it without using third party software which I am not allowed to to use due software usage restrictions. As a solution I have written a C / C++ program which can be added