• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Windows: “Access Denied” When Running Attrib

Windows: “Access Denied” When Running Attrib

August 1, 2017 by Mitch Bartlett 7 Comments

Today I was helping a Microsoft Windows 10 user that couldn’t read or write to files in a folder on the network. I figured something was set on the files that had them set to Read Only. So I ran the following DOS command on the folder containing the files:

attrib *.*  -r +a -s -h /s

Some of the files were changed fine, but others threw an access denied error message. There are a few things to check when this happens. We’ll cover the most common in this guide.

1. Be Sure You are Running the Command With Admin Rights

  1. Click “Start“, then type “CMD“.
  2. Right-click on “Command Prompt“, then choose “Run as Administrator“. This will give you proper rights.
  3. Type the attrib command

2. Check if File is in Use

Are any of the files in use by a program or open on another computer that is connected? Ensure nothing has access to the file when trying to run attrib. If you can’t track down if the file is in use, you may want to try starting the computer in Safe Mode.

3. Check Permissions

Do you have access to all of the files you are running attrib on? You can check this with these steps:

  1. Right-click the folder you’re working with then select “Properties“.
  2. Select “Security“.
  3. Select the “Edit…” button to edit permissions.
  4. Select “Add…“.
  5. Type your username to allow just your account access, or type “EVERYONE” to allow access to anybody. Select “OK” when you’re ready.
  6. With the account you just added higlighted in the “Group or user names” area, select the “Allow” check for “Full control“. Select “OK” when you’re ready.

4. Check File System or Disk

It’s very common for attrib to throw “Access Denied” errors if there is problem with the hard drive. Try running CHKDSK /F on the drive from a DOS command prompt, then try to run attrib again when it’s finished scanning.

Hopefully, a set of instructions above helped. Please feel free to share your experience in the comments section below.

You Might Also Like

  • Windows 10: Access Denied When Modifying HOSTS or LMHOSTS file
    Windows 10: Access Denied When Modifying HOSTS or LMHOSTS…
  • Windows: "User username (SessionId=2) could not be logged off. Access is denied." Fix
    Windows: "User username (SessionId=2) could not be logged…
  • Acrobat Reader: Fix "There was an error opening this document. Access denied."
    Acrobat Reader: Fix "There was an error opening this…
  • Fix "Access to the registry key is denied" Error When Setting Policy For PowerShell Scripts
    Fix "Access to the registry key is denied" Error When…
  • Can't Delete Folder "You have been denied permission" Fix for Windows
    Can't Delete Folder "You have been denied permission" Fix…
  • How Do I Know if Backup Is Running on Windows 10?
    How Do I Know if Backup Is Running on Windows 10?

Filed Under: Windows Tagged With: Windows 10

Reader Interactions

Comments

  1. charles says

    February 5, 2022 at 3:52 am

    Actually, it didn’t help, already went through all the above steps, multiple times.
    It says I have full administrative control in group / account. I’m the only user, but I can’t change hidden status in cmd or file explorer.
    help???

  2. Rizwan says

    December 9, 2021 at 7:57 am

    Yes it is very useful.
    Tahnks a lot.

  3. surinder says

    June 4, 2021 at 11:06 am

    i face the same problem access denied for attrib even after make changes in propties please provied any other solution

  4. Mihai Frumușelu says

    May 7, 2020 at 8:39 am

    Thank you so much, Mitch! I ran it as an administrator and it worked.

  5. TEMITOPE OSANYIN says

    December 18, 2018 at 4:59 pm

    Yeah! It helped.

  6. Michael says

    October 18, 2018 at 6:10 am

    This is a very awesome guide. tried different varieties of the attrib command for weeks now and I just keep getting access denied. Tried your attrib string and it finally work. Thank you very much Mitch! you are a gentleman and a scholar.

  7. Ganiyu Sodiq Olaniyi says

    August 10, 2018 at 5:50 am

    Thank you Mitch for this guide. I will add this to my cmd tricks.

Did this help? Let us know!

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • How to Print Labels from Excel Using MS Word Mail Merge
  • What Is NVMe Over TCP (NVMe/TCP)
  • Android Mobile Hotspot: How to Change the Password and Name
  • Windows 10: How to Force Quit and App
  • What is Dumpster Diving?
  • How to Download iOS 16 Beta 3 on iPhone or iPad
  • What is a Security Compromise?
  • Mastodon: How to DM Someone

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

You May Also Like

  • Random Access Memory (RAM)
  • Windows 95/98
  • Microsoft Windows NT
  • Microsoft Windows
  • Microsoft Windows 95
  • Windows Media Player (WMP)

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy