Jump to content

Cannot write to file when running from a service


Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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 :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...