FileSystemObject - MoveFolder

Results 1 to 3 of 3

Thread: FileSystemObject - MoveFolder

  1. #1
    Join Date
    Dec 1969

    Default FileSystemObject - MoveFolder

    I&#039;m having a few problems with this. I&#039;m trying to rename a folder obviously via an ASP page using the FileSystemObject. Here&#039;s the code I&#039;m using: (Trying to rename the directory &#039;oldname&#039; to &#039;newname&#039; in this example.)<BR><BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR> <BR>objFSO.MoveFolder "e:
    ootoldname", "e:
    ewname"<BR><BR>I get the following error:<BR><BR>Error Type:<BR>Microsoft VBScript runtime (0x800A0046)<BR>Permission denied<BR>/folder/file.asp, line 100<BR><BR>I&#039;m almost 100% sure that this isn&#039;t an permisions problem, as I&#039;m using the File System Object on the same site to create directory&#039;s, delete files etc without any problems, unless the MoveFolder command needs different rights - although I can&#039;t think it would need anymore rights than deleting a file - which I can do.<BR><BR>Any ideas/comments welcome.<BR><BR>Thanks in advance,<BR>Gwyn.

  2. #2
    Join Date
    Dec 1969

    Default Where are permissions set?

    Have you set the permissions on the folder e:
    oot or e:
    ootoldname<BR><BR>If you have set it to e:
    oot, I don&#039;t know what your problem could be.<BR><BR>If you have it set to e:
    ootoldname, your problem is that it can&#039;t create the "newname" folder in the root folder.<BR><BR>-Doug

  3. #3
    Join Date
    Dec 1969

    Default RE: Where are permissions set?

    All permisions are inherited, there are no particular permissions set on the folder I&#039;m trying to change the name off.<BR><BR>I&#039;ve just discovered that if I try the same code on a folder that has no sub-folders it works fine. But only fails if the folder I&#039;m trying to change the name of has subfolders. eg. I&#039;m trying to change the name of the folder &#039;oldname&#039;:<BR>e:
    ootoldnameanotherfolder<BR>It fails - with the error.<BR><BR>Any ideas why this causes a problem? Ways around it?<BR><BR>Thanks again in advance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts