Announcement

Collapse
No announcement yet.

Delete a folder

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Delete a folder

    Hi,

    I have server 2003.. I made it a file server for network sharing. I have a folder on it with many child folders inside it. Some of the child folders are corrupted in the sense its security tab doesn't contain inherited security group from root folder(Actually there are no groups).

    Now when I go for deleting the root folder and since child folder doesn't have any security group, so i don't have full control over child folder to delete it. Hence, even if I have full control over root folder, I'm not able to delete root folder... My motive is to delete root folder completely.

    I tried inheriting the security groups of root folder to its child folder, but as the size of the folder is large it will take about a day for inheritance.

    Is there any other way around to delete the folder?

  • #2
    Re: Delete a folder

    You might try to take ownership of the file and folders.
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: Delete a folder

      Here's a batch file I wrote to take ownership of a directory and all sub folders and files. Using the GUI can be an issue if you don't have permissions on files and folders lower in the hierarchy.

      Code:
      set /P _takeOwnDir=Please enter the directory you want to take ownership of...
      :: Set the owner to the administrators group and change the permissions to inherit
      :_SetPerm
      takeown /F %_takeOwnDir%\* /R /D N /A
      icacls %_takeOwnDir%\* /inheritance:e /T /C
      
      :: If there's an error loop back and set ownership and permissions again
      If NOT %errorlevel%==0 goto _SetPerm
      
      :: After errorlevel of 0, process files one more time then set proper user as owner of files and folders
      takeown /F %_takeOwnDir%\* /R /D N /A
      icacls %_takeOwnDir%\* /inheritance:e /T /C
      Regards,
      Jeremy

      Network Consultant/Engineer
      Baltimore - Washington area and beyond
      www.gma-cpa.com

      Comment

      Working...
      X