WatchDirectory Forum | |
https://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Bug Reports >> run as service https://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1128515252 Message started by spoppe on Oct 5th, 2005 at 1:27pm |
Title: run as service Post by spoppe on Oct 5th, 2005 at 1:27pm
I succesfully created a job which starts a batch file that monitors files in a specified directory and depending on the action (delete or insert), updates a table in an Oracle database. When I try to start this job as a service, nothing happens, no triggering actions occur. Can someone help me with this issue? Thanks, greets
|
Title: Re: run as service Post by Gert on Oct 5th, 2005 at 1:59pm
You'll have to remember that when you run as a service, no user is logged in. This means that network-drives are not mapped (X:\ is not present).
To "debug" this, let the service start a .bat file with only this line inside: [code]echo started for file %WD_FILE% >> c:\temp\debug.txt[/code] That will "prove" that watchDirectory is reacting to filesystem changes. Gert |
Title: Re: run as service Post by spoppe on Oct 6th, 2005 at 12:39pm
Run your batch file as service works correctly. Is it possible to monitor network directories ?
|
Title: Re: run as service Post by Gert on Oct 6th, 2005 at 5:19pm Quote:
Yes, you can monitor the UNC name (\\server\share\directory). However, the Service, by default, runs as the "user" LocalSystem. The LocalSystem user can do anything you want on the local computer, but normally has very limited rights to the network. Also, your .bat file can not use mapped drives (X:), but should use UNC names as well. You can use the standard Windows Services applet (on the control panel) to change the user that this watchdirectory task runs. If you use a userid that *has* access to the network folder, it should be ok. Note that the user needs extra privileges to "run as a service". For example, administrators have those privileges. Normal users need the additional "act as part of the operating system" privilege (see the security policy applet). Gert |
WatchDirectory Forum » Powered by YaBB 2.5.2! YaBB Forum Software © 2000-2025. All Rights Reserved. |