0

Running this very simple VBS script on a Win7 Professional 64 bit and getting a Permission denied (800A0046) error message. Is there a way to change the OS permissions to allow for that?

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "C:\Users\Desktop\Source\1.txt", "C:\Users\Desktop\Destination"
FSO.Close 
entrup
  • 113
  • 3
  • 16
  • Is that the real path? `C:\Users\Desktop\..` or you forgot to put username there? – fa wildchild Oct 17 '14 at 02:31
  • 1
    1. You should end _the destination folder name_ with a backslash: `"C:\Users\Desktop\Destination\"`. 2. `FSO.Close`: `Close` is not valid metod for a `FileSystemObject` object – JosefZ Oct 17 '14 at 15:25
  • possible duplicate of [Permission denied on CopyFile in VBS](http://stackoverflow.com/questions/16071679/permission-denied-on-copyfile-in-vbs) – Ansgar Wiechers Oct 18 '14 at 22:57
  • Thanks a bunch JoseFZ, all working now. – entrup Oct 20 '14 at 04:40

0 Answers0