![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Copy file to Document and Settings folder permission problem 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" *** Sent via Developersdex http://www.developersdex.com *** |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Copy file to Document and Settings folder permission problem Try to copy the script: Copying a File Demonstration script that uses the FileSystemObject to copy a file. Script must be run on the local computer. Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.CopyFile "C:\FSO\ScriptLog.txt" , "D:\Archive\", OverwriteExisting source: http://www.activexperts.com |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Copy file to Document and Settings folder permission problem "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" 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. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Copy file to Document and Settings folder permission problem "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. 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 |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Copy file to Document and Settings folder permission problem The problem is with script not with permissions However if you wantto copy to share folder you need to have domain user rights. Regards, |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| document and settings access problem | Vista file management | |||
| Lost document or file folder | Vista file management | |||
| You need permission to perform this action!! to copy a file to a directory with Admin rights | Vista security | |||
| View and copy document content without opening the document | Vista General | |||
| View and copy document content without opening the document | Vista performance & maintenance | |||