Re: permission denied when moving folder




"Tom Lavedas" <tglbatch@xxxxxxx> wrote in message
news:aee22b1a-eb43-41d0-be0c-3a6b9acb5515@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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/

I read what you wrote but my tests tell me something else.
Both of the following scripts fail:
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Thu" , "D:\Thu"

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Thu" , "D:\"

whereas this one works:
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "C:\Thu" , "C:\Wed"

Since drive D: is a FAT32 volume, there are no permission
issues. What do you get when you try this script?


.



Relevant Pages

  • access txt file on a linux server that has samba setup?
    ... I have a network share setup on a linux server that I can access from windows. ... I want to access the files using script to automatically configure the files ... Set objFSO = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: win32_product in windows 2003
    ... I got this script from microsoft.com.But this script is not available ... Set objFSO = CreateObject ... objTextFile.WriteLine objSoftware.Caption & vbtab & _ ... supported in Windows Server 2003. ...
    (microsoft.public.scripting.vbscript)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.misc)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.firewalls)
  • [NT] Flaw in Windows Script Engine Could Allow Code Execution
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The Windows Script Engine provides Windows operating systems with the ... blocked by Outlook Express 6.0 and Outlook 2002 in their default ...
    (Securiteam)