Skip to content
LogoTechnipages
LogoTechnipages
  • Topics
        • Android
        • Browsers
        • Gaming
        • Hardware
        • Internet
        • iPhone
        • Linux
        • macOS
        • Office
        • Reviews
        • Software
        • Windows
        • Definitions
        • All Recent Posts
  • Product Reviews
  • About

Windows: “Access Denied” When Running Attrib

Mitch BartlettAugust 1, 2017 Comments (7)

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.

Contents

  • 1 1. Be Sure You are Running the Command With Admin Rights
  • 2 2. Check if File is in Use
  • 3 3. Check Permissions
  • 4 4. Check File System or Disk

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.

Categories: Windows

Author Mitch Bartlett

Through my career that spans over 20 years I have become an expert in Microsoft Systems Administration, Android, and macOS. I started this site as a technical guide for myself and it has grown into what I hope is a useful knowledgebase for everyone.

You Might Also Like

  • Fix – Unable to Copy and Paste to Remote Desktop Session

    Mitch BartlettWindows
  • Windows Defender Header

    Bypass Download Failed — Virus Detected Messages

    Mitch BartlettWindows
  • Windows 10 Header

    How to Make Windows Desktop Shortcut for Specific Browser

    Mitch BartlettWindows
  • Fix-Error-0x80070490-We-Couldnt-Find-Your-Settings

    Fix Error 0x80070490: We Couldn’t Find Your Settings

    Madalina DinitaWindows

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.

Leave a Reply

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

  • unable to create notebook error in onenote

    We Were Unable to Create Your Notebook Error in OneNote – Common Fixes 

  • error code 0x800704f8 fix

    Error Code 0x800704f8 – How to Fix 

  • back button in browsers doesnt work

    What to Do if the Back Button in Browser Doesn’t Work 

  • could not find this item

    “Could Not Find This Item” When Trying to Remove Files

  • no graphics signal on first boot

    No Graphics Signal on First Boot – How to Fix

profile pic

The Experts Behind Technipages

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.

Learn More

technipages logo white
linkedin icon

Technipages is part of Guiding Tech Media, a leading digital media publisher focused on helping people figure out technology. Learn more about our mission and team here.

© 2026 Guiding Tech Media All Rights Reserved

  • About Us
  • Contact
  • Terms of Use
  • Privacy Policy

© 2026 Guiding Tech Media All Rights Reserved

Information from your device can be used to personalize your ad experience.
Do not sell my personal information.