Solved Can't delete file - Can't access folder

Calab

New member
Local time
8:26 AM
Messages
21
Running Windows 7 Pro with Microsoft Security Essentials as my antivirus...

In my D:\TEMP folder there is a folder named CR_98F43.tmp. If I try to go into that folder I am denied permission. I'm told that I need to use the security tab to gain access. If I go to the folder properties, into the security tab, everything is greyed out... I can't alter anything.

I'm able to access the content of the folder in an Administrator command prompt. Inside this directory is a file named "SETUP_PATCH.PACKED.7Z". I cannot delete this file from the command line. I've even tried a utility named "BootDelete" to try and delete the directory without success.

What can I do to remove this file and folder?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom build
OS
Windows 7 Pro 64bit
CPU
AMD FX 6350 Six core CPU @ 3.9Ghz
Motherboard
Asus m5a88-m
Memory
24GB
Graphics Card(s)
nVidia GeForce GTX 660
Sound Card
Onboard
Monitor(s) Displays
Vizio 32" TV + 24" Asus
Screen Resolution
1980x1200 (x2)
Hard Drives
240Gb OCZ Agility 3 (C:)
1TB Western Digital (D:)
120Gb OCZ Agility 3 (E:)
PSU
Corsair
Case
Centurion
Keyboard
Microsoft Wireless 3000 v2
Mouse
Microsoft Wireless 3000
Antivirus
MSE
Hi Calab,

You can tell us the permission settings of the outer most item you are denied access from.

Open a PowerShell session, run the below line and post it's output here for us.
Code:
"[COLOR=red]D:\TEMP[/COLOR]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner; ''; $a.AccessToString
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Hi Calab,

You can tell us the permission settings of the outer most item you are denied access from.

Open a PowerShell session, run the below line and post it's output here for us.
Code:
"[COLOR=red]D:\TEMP[/COLOR]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner; ''; $a.AccessToString
Opened Powershell:
Code:
PS D:\> "[B]D:\TEMP[/B]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner; ''; 
$a.AccessToString
 
Steve
StevesPC\Steve
 
Everyone Allow  -1
PS D:\>
PS D:\> "[B]D:\TEMP\CR_98F43.tmp[/B]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner; ''; $a.AccessToString
[COLOR=red]Get-Acl : Attempted to perform an unauthorized operation.[/COLOR]
[COLOR=red]At line:1 char:40[/COLOR]
[COLOR=red]+ "D:\TEMP\CR_98F43.tmp" | %{$a = Get-Acl <<<<  $_} ; ''; $env:Username; $a.Owner; ''; $a.AccessToString[/COLOR]
[COLOR=red]    + CategoryInfo          : NotSpecified: (:) [Get-Acl], UnauthorizedAccessException[/COLOR]
[COLOR=red]    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetAclCommand[/COLOR]
 
Steve
StevesPC\Steve
Everyone Allow  -1
PS D:\>

Opened Powershell as administrator:
Code:
PS D:\> "[B]D:\TEMP\CR_98F43.tmp[/B]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner; ''; $a.AccessToString
Steve
NT AUTHORITY\SYSTEM
NT AUTHORITY\SYSTEM Allow  FullControl
BUILTIN\Administrators Allow  ReadAndExecute, Synchronize
PS D:\>
PS D:\temp\CR_98F43.tmp> "[B]D:\TEMP\CR_98F43.tmp\SETUP_PATCH.PACKED.7Z[/B]" | %{$a = Get-Acl $_} ; ''; $env:Username; $a.Owner
; ''; $a.AccessToString
Steve
NT AUTHORITY\SYSTEM
NT AUTHORITY\SYSTEM Allow  FullControl
BUILTIN\Administrators Allow  ReadAndExecute, Synchronize
PS D:\temp\CR_98F43.tmp>

When I attempt to delete the file, in Powershell as administrator:
Code:
PS D:\temp\CR_98F43.tmp> [B]del .\SETUP_PATCH.PACKED.7Z[/B]
[COLOR=red]Remove-Item : Cannot remove item D:\temp\CR_98F43.tmp\SETUP_PATCH.PACKED.7Z: Access to the path 'D:\temp\CR_98F43.tmp\S
ETUP_PATCH.PACKED.7Z' is denied.
At line:1 char:4
+ del <<<<  .\SETUP_PATCH.PACKED.7Z
    + CategoryInfo          : PermissionDenied: (D:\temp\CR_98F4...PATCH.PACKED.7Z:FileInfo) [Remove-Item], Unauthoriz
   edAccessException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand[/COLOR]
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom build
OS
Windows 7 Pro 64bit
CPU
AMD FX 6350 Six core CPU @ 3.9Ghz
Motherboard
Asus m5a88-m
Memory
24GB
Graphics Card(s)
nVidia GeForce GTX 660
Sound Card
Onboard
Monitor(s) Displays
Vizio 32" TV + 24" Asus
Screen Resolution
1980x1200 (x2)
Hard Drives
240Gb OCZ Agility 3 (C:)
1TB Western Digital (D:)
120Gb OCZ Agility 3 (E:)
PSU
Corsair
Case
Centurion
Keyboard
Microsoft Wireless 3000 v2
Mouse
Microsoft Wireless 3000
Antivirus
MSE
One item I should mention is that my %TEMP% and %TMP% variables point to E:\Temp. Nothing should be using D:\Temp. I moved my temp directory to a dedicated drive last week, as I had a small spare SSD laying around.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom build
OS
Windows 7 Pro 64bit
CPU
AMD FX 6350 Six core CPU @ 3.9Ghz
Motherboard
Asus m5a88-m
Memory
24GB
Graphics Card(s)
nVidia GeForce GTX 660
Sound Card
Onboard
Monitor(s) Displays
Vizio 32" TV + 24" Asus
Screen Resolution
1980x1200 (x2)
Hard Drives
240Gb OCZ Agility 3 (C:)
1TB Western Digital (D:)
120Gb OCZ Agility 3 (E:)
PSU
Corsair
Case
Centurion
Keyboard
Microsoft Wireless 3000 v2
Mouse
Microsoft Wireless 3000
Antivirus
MSE
Would it be cheating to pop in a linux boot stick and give it a try? DSL is a mere 50MB download.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
dell precision t3400 tower
OS
Linux Lite 3.2 x64; Windows 7, 8.1
CPU
Core2Duo 2.4
Memory
6GB ddr2
Graphics Card(s)
nVidia
Hard Drives
120gb SSD, 1TB HD, 2TB HD; sata II
Internet Speed
12/2
Browser
Vivaldi, Slimjet (Chromium) x64
Actually I wouldn't recommend DSL. It requires too much work to set up. Puppy or LinuxLite would be a better choice.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
dell precision t3400 tower
OS
Linux Lite 3.2 x64; Windows 7, 8.1
CPU
Core2Duo 2.4
Memory
6GB ddr2
Graphics Card(s)
nVidia
Hard Drives
120gb SSD, 1TB HD, 2TB HD; sata II
Internet Speed
12/2
Browser
Vivaldi, Slimjet (Chromium) x64
Finally got it fixed...

1- Boot into safe mode (not sure if it was necessary)
2- Open PowerShell as administrator
3- Used TAKEOWN to take ownership of the 7z file
4- Went to the properties of the file in Windows Explorer
5- I was able to give myself full control of the file
6- Deleted the file.

Tada!
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom build
OS
Windows 7 Pro 64bit
CPU
AMD FX 6350 Six core CPU @ 3.9Ghz
Motherboard
Asus m5a88-m
Memory
24GB
Graphics Card(s)
nVidia GeForce GTX 660
Sound Card
Onboard
Monitor(s) Displays
Vizio 32" TV + 24" Asus
Screen Resolution
1980x1200 (x2)
Hard Drives
240Gb OCZ Agility 3 (C:)
1TB Western Digital (D:)
120Gb OCZ Agility 3 (E:)
PSU
Corsair
Case
Centurion
Keyboard
Microsoft Wireless 3000 v2
Mouse
Microsoft Wireless 3000
Antivirus
MSE
Back
Top