Re: permission denied when moving folder



On Jan 30, 4:46 am, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"Lee Kok Onn" <ko...@xxxxxxxxxxxxxxxx> wrote in messagenews:eKJo2ByYIHA.4440@xxxxxxxxxxxxxxxxxxxxxxx

I use the following script to move folder from my server1 to another
server2 share folder.

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\data" , "\\server2\backup"

It will end with "permission denied" error. So how can I resolve this, pls
help.

Thanks

The MoveFolder method is basically a "rename" method,
hence it only works if the source and destination reside on
the same volume (same as move.exe under WinXP).

While the WSH 5.6 documentation does state a caveat:

"<b>Important</b> This method allows moving folders between volumes
only if supported by the operating system. "

This Technet Script Center example and associated documentation
suggests that this may not be the problem.

<Quote>
Description
Demonstration script that uses the FileSystemObject to move a folder
from one location to another. Script must be run on the local
computer.
Supported Platforms

Windows Server 2003 Yes
Windows XP Yes
Windows 2000 Yes
Windows NT 4.0 Yes
Windows 98 Yes

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Scripts" , "M:\helpdesk\management"
</Quote>

It is more likely to be related to a file or subfolder being in use at
the time of the attempted more - or related to the UNC addressed
target permissions.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.



Relevant Pages

  • Re: recover compacted folders
    ... Because of this tendency of attachments to infect, ... , then wasted space is generated in that file, and the folder must be ... Windows 2000 and Windows XP. ... Windows XP Service Pack 2 Resources for IT Professionals ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: inbox mostly not open
    ... messages to another folder. ... > When I open Outlook Express it's open automatikly the Inbox. ... Turn off email scanning in your antivirus software. ... themselves (if you have the latest security updates from Windows Update) ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: OE & SP2 missing Local Folders
    ... , then wasted space is generated in that file, and the folder must be ... Turn off email scanning in your antivirus software. ... Windows 2000 and Windows XP. ... Windows XP Service Pack 2 Resources for IT Professionals ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Lost Emails Information During "Compacting" of Folders
    ... , then wasted space is generated in that file, and the folder must be ... Options | Maintenance for each Identity you have, and then compact manually ... Turn off email scanning in your antivirus software. ... Windows 2000 and Windows XP. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: downloading messages
    ... , then wasted space is generated in that file, and the folder must be ... Options | Maintenance for each Identity you have, and then compact manually ... Turn off email scanning in your antivirus software. ... Windows 2000 and Windows XP. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)