I have a VBScript that is run as a Windows service. It works fine
except for the fact that an output file I write does not get created or
written to. If I run the same script manually (not as a service) the
file is written correctly.

The service is running as the localsystem account with interact with
desktop enabled.

Any thoughts on why the file does not get created?

TIA

Re: Running script as a service fails to write file by Ray

Ray
Wed Jun 07 08:50:35 CDT 2006

Are you attempting to create the file on a network share, or on a local
drive?

Ray at work

<jhmosow@gmail.com> wrote in message
news:1149630435.912196.82530@c74g2000cwc.googlegroups.com...
>I have a VBScript that is run as a Windows service. It works fine
> except for the fact that an output file I write does not get created or
> written to. If I run the same script manually (not as a service) the
> file is written correctly.
>
> The service is running as the localsystem account with interact with
> desktop enabled.
>
> Any thoughts on why the file does not get created?
>
> TIA
>



Re: Running script as a service fails to write file by jhmosow

jhmosow
Wed Jun 07 09:04:11 CDT 2006

The file is being written to the local drive, the same location as
where the script runs.

Ray Costanzo [MVP] wrote:
> Are you attempting to create the file on a network share, or on a local
> drive?
>
> Ray at work
>
> <jhmosow@gmail.com> wrote in message
> news:1149630435.912196.82530@c74g2000cwc.googlegroups.com...
> >I have a VBScript that is run as a Windows service. It works fine
> > except for the fact that an output file I write does not get created or
> > written to. If I run the same script manually (not as a service) the
> > file is written correctly.
> >
> > The service is running as the localsystem account with interact with
> > desktop enabled.
> >
> > Any thoughts on why the file does not get created?
> >
> > TIA
> >


Re: Running script as a service fails to write file by jhmosow

jhmosow
Wed Jun 07 09:30:46 CDT 2006

Operator Error! I found the problem. It was creating the file but not
in the directory I thought it should be. I changed the script to write
the file specifically in the directory where the script resides and all
is well.


jhmosow@gmail.com wrote:
> The file is being written to the local drive, the same location as
> where the script runs.
>
> Ray Costanzo [MVP] wrote:
> > Are you attempting to create the file on a network share, or on a local
> > drive?
> >
> > Ray at work
> >
> > <jhmosow@gmail.com> wrote in message
> > news:1149630435.912196.82530@c74g2000cwc.googlegroups.com...
> > >I have a VBScript that is run as a Windows service. It works fine
> > > except for the fact that an output file I write does not get created or
> > > written to. If I run the same script manually (not as a service) the
> > > file is written correctly.
> > >
> > > The service is running as the localsystem account with interact with
> > > desktop enabled.
> > >
> > > Any thoughts on why the file does not get created?
> > >
> > > TIA
> > >


Re: Running script as a service fails to write file by Ray

Ray
Wed Jun 07 09:50:17 CDT 2006

Give Everyone full NTFS permissions, temporarily, and see if that helps at
all. Also, is your script doing anything else that you can use to verify
that it's running? If not, you could do something like:

Dim oShell
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c net send %computername% I'm about to attempt to
write", 0

On Error Resume Next
'''code to write to file
sErrNumber = Err.Number
sErrDescription = Err.Description
On Error Goto 0

oShell.Run "%comspec% /c net send %computername% I'm finished attempting.
The error information: ¶¶Error Number: " & sErrNumber & "¶Error
Description: " & sErrDescription, 0

Set oShell = Nothing

Ray at work




<jhmosow@gmail.com> wrote in message
news:1149689051.835823.271280@i40g2000cwc.googlegroups.com...
> The file is being written to the local drive, the same location as
> where the script runs.
>
> Ray Costanzo [MVP] wrote:
>> Are you attempting to create the file on a network share, or on a local
>> drive?
>>
>> Ray at work
>>
>> <jhmosow@gmail.com> wrote in message
>> news:1149630435.912196.82530@c74g2000cwc.googlegroups.com...
>> >I have a VBScript that is run as a Windows service. It works fine
>> > except for the fact that an output file I write does not get created or
>> > written to. If I run the same script manually (not as a service) the
>> > file is written correctly.
>> >
>> > The service is running as the localsystem account with interact with
>> > desktop enabled.
>> >
>> > Any thoughts on why the file does not get created?
>> >
>> > TIA
>> >
>