views:

42

answers:

3

Hello everyone. I'm doing a Windows Service in Java, this service list the files in a directory and write the results in a file. My problem is that when i call Java.File.isDirectory() when the service is running it always results false (It works well when i run the service manually as any other program). Besides, if i try the following: for(File F : directorio.listFiles()) trows an exception when i run the program as a service. I believe is permission related, because when i change the account in which the service is running to my own credentials it list the files correctly. Do you know if there is a workaround? (Change a windows policy, another kind of special account, another way to list the files of the directory, any other thing maybe i'm missing). Thanks in advance.

A: 

Give the user the Java service is running under, the needed credentials to the folder in question.

I belive it runs as SYSTEM.

Thorbjørn Ravn Andersen
A: 

This is an admin question. Try http://serverfault.com/search?q=windows+service+permissions

Peter Knego