• Skip to main content
  • Skip to primary sidebar

Technipages

Smart phone, gadget and computer tutorials

  • Topics
    • Android
    • Gaming
    • Hardware
    • Internet
    • iOS
    • MacOS
    • Office
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Windows: “Access Denied” When Running Attrib

Windows: “Access Denied” When Running Attrib

By Mitch Bartlett 4 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 fileWindows 10: Access Denied When Modifying HOSTS or…
  • Acrobat Reader 11: Fix "There was an error opening this document. Access denied."Acrobat Reader 11: Fix "There was an error opening…
  • Error: "User username (SessionId=2) could not be logged off. Access is denied."Error: "User username (SessionId=2) could not be…
  • Fix "Access to the registry key is denied" Error When Setting Policy For PowerShell ScriptsFix "Access to the registry key is denied" Error…
  • Can't Delete Folder "You have been denied permission" Fix for WindowsCan't Delete Folder "You have been denied…
  • Installing and Running Snapchat App on Windows 10Installing and Running Snapchat App on Windows 10
  • Windows 10: Fix "This publisher has been blocked from running software..."Windows 10: Fix "This publisher has been blocked…
  • Fix for “The print spooler service is not running” Error in WindowsFix for “The print spooler service is not running”…
  • How to Access Drivers in Windows 10How to Access Drivers in Windows 10

Filed Under: Windows Tagged With: win7, Windows 10

Reader Interactions

Comments

  1. 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.

  2. TEMITOPE OSANYIN says

    December 18, 2018 at 4:59 pm

    Yeah! It helped.

  3. 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.

  4. 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! Cancel reply

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

  • Android 10: How to Adjust the Keyboard Size
  • OneNote Error Code 0xE00001AE – Fix
  • WhatsApp: How to Change Your Phone Number
  • Fix OneNote Error 0xe00001bb: Section Is Corrupted
  • Zoom: How to Show the Unread Message Icon
  • How To Calculate Tips on Android
  • What to Do If Chrome Download Needs Authorization
  • Fix OneNote Error 0xE401065D, 0xE000145C, 0xE4010640

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.

Follow me on Twitter, or visit my personal blog.

You May Also Like

  • Random Access Memory (RAM)
  • Windows 95/98
  • Microsoft Windows 95
  • Microsoft Windows
  • Microsoft Windows NT
  • Windows Media Player (WMP)
  • Top 8 Itunes Alternatives for Windows

© Copyright 2021 Technipages · All Rights Reserved · Privacy