Sign in to follow this  
Followers 0
DeFirence

Cannot write to file when running from a service

7 posts in this topic

Hi all

I spent the majority of yesterday trying to find a solution to this before finally coming here...

I use srvany.exe from Microsoft to make my script run as a service, but when it runs from the service, it is unable to write to a file.

I have made a test script that makes one file and one folder and when i run it as a limited user or administrator it works perfectly, but when it is run by srvany running under the administrator account or the local system account, or even by a another script that is run by srvany, the files do not get written to disk.

;~ Client.au3
;~ Test code for writing to disk
FileWrite("test.txt", "test!")
DirCreate("testdir")oÝ÷ Ù«­¢+ØíøIÕ¹
±¥¹Ð¹ÔÌ(íø
½½ÈÉÕ¹¹¥¹Ñ¡ÑÍн)IÕ¹Í]¥Ð ÅÕ½Ðíµ¥¹¥ÍÑÉѽÈÅÕ½Ðì°
½µÁÕÑÉ9µ°ÅÕ½Ðíµ¥¸ÅÕ½Ðì°À°ÅÕ½Ðí
±¥¹Ð¹áÅÕ½Ðì¤

Client.au3 doesnt write to disk if run directly by srvany or if run my RunClient.au3 which is run by srvany...

Thanks

DeFirence

Share this post


Link to post
Share on other sites



No one? :<

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry to bump the topic again but come on guys, 219 views and not one reply? someone must know?

Edited by DeFirence

Share this post


Link to post
Share on other sites

which operating system do you use?

under what account the service is running? system-acount?

mayby a right problem!?! :)

Share this post


Link to post
Share on other sites

which operating system do you use?

under what account the service is running? system-acount?

mayby a right problem!?! :)

I'm using xp and like I said, I've tried many times using the system account and the administrator account.

Thanks for the reply.

DeFirence

Share this post


Link to post
Share on other sites

Specify the file path of the target file because the service is likely to have a different working directory.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I'm using xp and like I said, I've tried many times using the system account and the administrator account.

Thanks for the reply.

DeFirence

XP pro or home?

Have you also tried to set the hook "interact with the desktop" for the service?

Is there any entrance of error-message in the eventviewer?

Hope we an find the problem together :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0