Re: permission denied when moving folder



Thanks for the info.

I try to use movefile in the script and I need to overwrite the same file everyday. But it prompt an error "file already exist". So its there anyway that I can overwrite the file using movefile.

Thanks.


"Tom Lavedas" <tglbatch@xxxxxxx> wrote in message news:681c1307-46e9-48a4-860f-2a23d6bf1401@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jan 30, 8:40 am, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"Tom Lavedas" <tglba...@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?

I had to use different source and destination locations, but as you
assert, the documentation seems to be in error. The move attempt to a
network drive addressed as H:\ failed (with a permission denied, even
though I have appropriate permissions there), while a move to the same
NTFS local drive worked.

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

.



Relevant Pages

  • Re: editing licensed shows
    ... You can do almost anything with CHESS if you get permission. ... the first productions done after Broadway was by the Long Beach Civic ... The script was very much changed by director ...
    (rec.arts.theatre.musicals)
  • RE: Help needed setting user security rights through a script
    ... 'this script will set permission on given folder... ... 'Folder on which permissions will be applied, ... 'users:C means "Users" group will be assigned Change permission. ... > install or uninstall applications. ...
    (microsoft.public.windows.server.scripting)
  • Re: User Account Security
    ... Better post this under the original posting, so that anybody could follow it and find it again. ... after some times about 30 minutes all permission changed with other ... I created a script and disabled this settings ... the password you add two deny ACE's to the DACL. ...
    (microsoft.public.windows.server.active_directory)
  • IIS5.1 and permissions
    ... increment by one, write the new value back to the text file,. ... Develoing pages under XP Pro on my home computer with IIS5.1, the script ... It can read the file contents, but refuses to overwrite the file. ... looks to me like a sever permission issue with XP. ...
    (microsoft.public.inetserver.iis.security)
  • RE: Permission Denied 800A0046 GetObject
    ... Actually I got the script working via a text file containing the names of the ... For Each strComputer In arrComputers ... Set colIESettings = objWMIService.ExecQuery _ ... > and I get an error 800A0046 Permission Denied error on GetObject...now I get ...
    (microsoft.public.windows.server.scripting)

Loading