"James Whitlow" <jwhitlow.60372693@xxxxxx> wrote in message
news:OU5Er60HJHA.788@xxxxxx
Quote:
> "Philip Tattersall" <philip@xxxxxx> wrote in message
> news:esPQYIwHJHA.3736@xxxxxx Quote:
>>
>> I am trying to copy a file from a location on a server into the
>> following directory on local pc's
>> C:\Documents and Settings\All Users\Application Data
>>
>> I can copy the file with no trouble to c:\Documents and Settings.
>> However I get a permission denied error code 800a0046 message and the
>> script fails when trying o copy to
>> C:\Documents and Settings\All Users\Application Data.
>>
>> The code I'm using is below. Any suggestions would be much appreciated.
>>
>> Dim FSO
>>
>> Set FSO = CreateObject("Scripting.FileSystemObject")
>>
>> FSO.CopyFile "z:\scripts\test.txt", "C:\Documents and Settings\All
>> Users\Application Data"
>
> You need to add a backslash to the end of your destination so that it
> knows it is a directory. As written, it is trying to copy 'test.txt' to
> 'C:\Documents and Settings\All Users' with a filename of 'Application
> Data'. The error is a result of there already being a folder with that
> name in the directory. Or, since the copy seems to be from a remote share mapped as Z:, perhaps
this is running as a logon script in the security context of an account that
does not have local admin privileges. If so, it might be better to run a
script that pushes the file out to remote systems' in that particular
folder.
/Al