Windows Service does not work but Exe with UI works fine
We have a simple Windows Service that we wrote in C# that is supposed to watch a folder and run a batch file when a new file arrives. On two systems (Win XP and Win 2008), the service works fine but on a Windows 2003 server, it does not work. We made an EXE with UI and tested and that works fine. The service shows up under services.msc and you can start and stop it. There are no errors in Event Log but it does not run that batch file.
Any ideas?
It's possible that on Windows 2003/2008 your server has no rights to write/modify files so it can not do your task. In this case the server has no rights to write in the log file as well. You can run filemon ( http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx ) to monitor files activity at your server. This program will show information if your server tries to open/change files and display result.
I hope that will help.
zakali
ASKER
I stopped the service and changed the account to administrator but that did not help. I'll try to monitor files activity using filemon. Thanks
kaufmed
When you say "it doesn't run," what do you mean? Do you mean you don't see it run, or that it doesn't move files. Because you executing a process from within the code space of a service, you will not see any interaction with the desktop of the logged in user--they are two separate spaces.
I mean it does not run the batch file and it does not make an entry in the log file. The service seems to be running. I ran Process Monitoring tool but I am not sure what I am supposed to be looking for.
I hope that will help.