Tom
Fri May 02 08:05:47 CDT 2008
On May 2, 1:21 am, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "Adam Sandler" <cor...@excite.com> wrote in message
> news:b032b5b6-7f15-492a-a0b9-de26fa57a6fc@q1g2000prf.googlegroups.com...
>
> > Hello,
>
> > Using this script derived from a scriptcenter example, I'm trying to
> > move a file:
>
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > objFSO.MoveFolder "C:\Temp" , "C:\Logs"
>
> > The above works but when I change the destination to a different
> > drive:
>
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > objFSO.MoveFolder "C:\Temp" , "D:\Logs"
>
> > the script fails. I can move a folder from some source on C:\ to some
> > other location on C:\. But if the same operation tries to move from
> > C:\ -> D:\ then it fails with:
>
> > Line 2 Char 1
> > Permission denied
> > 800A0046
>
> > What is really confusing to me is I'm running the script as a member
> > of domain administrators and that account has write access to D:\.
> > How can I get this script to move folders across drives?
>
> > Suggestions are greatly appreciated.
>
> > Thanks!
>
> Your Subject line says "moving a file" but you're actually moving
> a folder. While you can move files with the "movefile" method from
> one drive to another, you cannot move folders with the "movefolder"
> method.
I remember this subject coming up recently and you said the same
thing, however, since all of the WSH documentation and the Script
Center example says otherwise, it might be useful to refer back to
that recent thread. It should shed some light on the issue for the OP
as well as indicate workarounds.
http://groups.google.com/group/microsoft.public.scripting.wsh/browse_frm/thread/064d1389d103b01d/653eaacfbff28e2c?#653eaacfbff28e2c
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/