FileSystemObject DeleteFolder Permission Denied

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Katja

    FileSystemObject DeleteFolder Permission Denied

    Dear all,

    I have a script that creates a FileSystemObjec t to be used for
    folder/directory manipulation. What I am trying to do is to search the
    drive if folder exist. If it doesn't it creates a new folder, but if
    the folder exists it deletes the old folder and creates a new one. The
    error refers to the line where I am deleting the folder. Here is my
    code:

    zip_path = "C:\cd_buil d"

    If fso.FolderExist s (zip_path & "\to_Zip") Then
    error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )
    fso.CreateFolde r (zip_path & "\to_Zip" )
    else
    fso.CreateFolde r (zip_path & "\to_Zip" )
    end if

    And this is the error I am getting:

    Microsoft VBScript runtime error '800a0046'

    Permission denied

    I have all the rights (full control) to the folder.

    If I am trying to delete the folder in the Windows Explorer it gives
    me and error for Sharing Violation. This foder is not used by any
    other program, open anywhere else or anything.
    I have no idea what is going on!!

    Please somebody help me.

    Thanks
    Katja
  • Ray at

    #2
    Re: FileSystemObjec t DeleteFolder Permission Denied

    Is this folder shared?

    Ray at work

    "Katja" <katjarahkola@h otmail.com> wrote in message
    news:a2aa0094.0 309260501.38209 8eb@posting.goo gle.com...[color=blue]
    > zip_path = "C:\cd_buil d"
    >
    > If fso.FolderExist s (zip_path & "\to_Zip") Then
    > error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )[/color]
    [color=blue]
    > I have all the rights (full control) to the folder.
    >
    > If I am trying to delete the folder in the Windows Explorer it gives
    > me and error for Sharing Violation.[/color]


    Comment

    • Katja

      #3
      Re: FileSystemObjec t DeleteFolder Permission Denied

      Hi Ray,
      Yep, the folder is shared.
      I tried to close the sessions and stuff as if it was thinking that the
      folder was in use but still no joy.
      Any other thoughts?

      Katja

      "Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message news:<OEeB9bDhD HA.3104@TK2MSFT NGP11.phx.gbl>. ..[color=blue]
      > Is this folder shared?
      >
      > Ray at work
      >
      > "Katja" <katjarahkola@h otmail.com> wrote in message
      > news:a2aa0094.0 309260501.38209 8eb@posting.goo gle.com...[color=green]
      > > zip_path = "C:\cd_buil d"
      > >
      > > If fso.FolderExist s (zip_path & "\to_Zip") Then
      > > error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )[/color]
      >[color=green]
      > > I have all the rights (full control) to the folder.
      > >
      > > If I am trying to delete the folder in the Windows Explorer it gives
      > > me and error for Sharing Violation.[/color][/color]

      Comment

      • Ray at

        #4
        Re: FileSystemObjec t DeleteFolder Permission Denied

        Delete the share?

        Ray at work


        "Katja" <katjarahkola@h otmail.com> wrote in message
        news:a2aa0094.0 310010057.6bf6e 563@posting.goo gle.com...[color=blue]
        > Hi Ray,
        > Yep, the folder is shared.
        > I tried to close the sessions and stuff as if it was thinking that the
        > folder was in use but still no joy.
        > Any other thoughts?
        >
        > Katja
        >
        > "Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message[/color]
        news:<OEeB9bDhD HA.3104@TK2MSFT NGP11.phx.gbl>. ..[color=blue][color=green]
        > > Is this folder shared?
        > >
        > > Ray at work
        > >
        > > "Katja" <katjarahkola@h otmail.com> wrote in message
        > > news:a2aa0094.0 309260501.38209 8eb@posting.goo gle.com...[color=darkred]
        > > > zip_path = "C:\cd_buil d"
        > > >
        > > > If fso.FolderExist s (zip_path & "\to_Zip") Then
        > > > error line -> fso.DeleteFolde r (zip_path & "\to_Zip" )[/color]
        > >[color=darkred]
        > > > I have all the rights (full control) to the folder.
        > > >
        > > > If I am trying to delete the folder in the Windows Explorer it gives
        > > > me and error for Sharing Violation.[/color][/color][/color]


        Comment

        • Katja

          #5
          Re: FileSystemObjec t DeleteFolder Permission Denied

          Hi Ray,
          Thanks for your reply but it didn't work either. The folder needs to
          be shared so that user has read and write access to it.
          I think the system somehow thinks that the folder is in use even it is
          not.
          The user did download the content of the folder just few secs earlier
          so maybe there is a way to tell it that it has finished downloading
          and then it would allow it to be deleted.

          Any thoughts?

          Thanks,
          Katja

          Comment

          Working...