cant delete Folders - no Permission

Discussion in 'Windows 7' started by sadom, Sep 7, 2009.

  1. sadom

    sadom MDL Novice

    Jul 8, 2009
    25
    1
    0
  2. sadom

    sadom MDL Novice

    Jul 8, 2009
    25
    1
    0
    allready tried
     
  3. searchengine

    searchengine Guest

    I have had similar problems ... short of using dynamite to get rid of folders or files ... try making bat file like this ... replace "ProblemFolderName" with name of folder you are trying to delete

    @echo off

    takeown /F "ProblemFolderName" /r /d y
    icacls "ProblemFolderName" /grant administrators:F /t
    rmdir /S /Q "ProblemFolderName"
    exit

    then just sit bat file next to folder and run the bat file ... worked for me.
     
  4. HSChronic

    HSChronic MDL Expert

    Aug 25, 2007
    1,213
    56
    60
    you can't delete the directory because something is using it. In the left hand pane collapse or close the folder window then try again from the main window.

    If that doesn't work try the following in a command prompt

    rd /s /q dirname

    create an empty directory with nothing in it then do this:

    robocopy /mir nameofemptydir nameofdiryouwanttoremove
     
  5. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,080
    60
    #6 Mr Jinje, Sep 7, 2009
    Last edited by a moderator: Apr 20, 2017
    Can anyone tell me if the Shell RunAs command is running in an elevated process or not ? For some reason I have not any trouble deleting any of these trustedinstaller files via right click in explorer, but others are reporting headaches.

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]

    Code:
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    
    
     
  6. HSChronic

    HSChronic MDL Expert

    Aug 25, 2007
    1,213
    56
    60
    runas always runs elevated

    when you put a runas command in the registry for a shell entry it tells the shell to elevate that command that you have entered.

    Like the Command Prompt Here as Admin type of thing:

    If you look at the folder entry in the shell and look under runas\command you will see cmd.exe and a some other stuff to get it to the dir but yes it runas elevated
     
  7. Lenmaer

    Lenmaer MDL Addicted

    Jul 3, 2009
    579
    3
    30
    #8 Lenmaer, Sep 7, 2009
    Last edited by a moderator: Apr 20, 2017
    It's mounted, you cannot take ownership of that.

    ________________________



    Unmounting an Image

    After you modify an image, you must unmount it. If you mounted your image with read/write permissions, you can commit your changes. This makes your modifications a permanent part of the image.

    To unmount an image

    1. On your technician computer, at a command prompt, open the ImageX directory.

      Code:
      C:\Program Files\<version>\Tools\<architecture>
      where <version> can be Windows OPK or Windows AIK, and <architecture> can be x86, amd64, or ia64.

    2. Unmount the image.

      Code:
      imagex /unmount /commit C:\mounted_images
      where C:\mounted_images is the location of the mount directory. If you do not specify the parameters to unmount, this option lists all of the mounted images but does not perform the unmount action.


    After modifying an image, you can apply the image from a network share or from local media, such as a CD/DVD or a USB flash drive (UFD).

    To manipulate images on a computer that does not have the Windows OPK or the Windows AIK installed, you must copy ImageX.exe, Wimmount.sys, Wimmount.inf and Wimserv.exe to the new computer. You must then install of the driver by right-clicking the Wimmount.inf file and then clicking Install. You must also add Wimserv.exe to your local path (\Windows\System32).
     
  8. sadom

    sadom MDL Novice

    Jul 8, 2009
    25
    1
    0
    #9 sadom, Sep 7, 2009
    Last edited: Sep 7, 2009
    (OP)
    I´ll try that, thanks @all

    I´ve done this on my old XP/ W7 config, installed W7 yesterday as single OS, WAIK is not installed at the moment > cannot be mounted


    first solution was, I move all data (150GB) to another HDD, then deleting Partition...
     
  9. sadom

    sadom MDL Novice

    Jul 8, 2009
    25
    1
    0
    #10 sadom, Sep 13, 2009
    Last edited: Sep 13, 2009
    (OP)
    Solution was:
    setting Permissions for complete partition, all folders and files to: all

    deleting is now possible