• How To?
  • Tips ‘n Tricks
  • WordPress
  • Snippets
  • Software
    • Browsers
    • Downloads
  • Web
  • Tools
    • Character Counter
    • chmod Calculator
    • Entities Encoder
    • Live HTML Editor
    • My IP
  • Contact
Twitter Facebook Google+ RSS
You are here: SumTips » Tips 'n Tricks » How To Make A File Read-Only In Windows

How To Make A File Read-Only In Windows

Posted on May 8, 2009 by Renji | Short URL: http://sumtips.com/?p=313

Here’s a quick tip if you have a file that you may not want anyone to change the contents or modify. In other words make the file read only.

Now this is not something that will completely prevent someone from changing the contents of the file, but I find it to be useful, more like a reminder) in situations where I want to prevent myself from changing the file accidentally.

After you have created the file (it can by any kind of file with any kind of extension), just right click on the file and select Properties.

In the Properties window, towards the bottom, click on the check box next to Read-only then click on OK to save the setting.

When you do try to save the file after making changes, you will see the following error message:

To not save the file, click OK (for the error message), then close the file and select Don’t Save.

With the Read-only attribute set, any changes to the file will be prevented until you un-check the setting for the file.

Using The Command Prompt:

If you prefer to use the command line to set the Read-only attribute, use the following command at the prompt: attrib +r filename

To reset the Read-only attribute (remove it and make the file writable again), use the following command at the prompt: attrib -r filename

Remember to replace filename with the actual name of the file.

Once you have set the Read-only attribute, it will remain even when you copy the file to another location on your computer or to another Windows computer.

Remember, this method is not a substitute for any kind of security, but is a nice solution…when you want to prevent yourself from modifying files that you don’t want changed.


Tweet

Related posts:

  • Save or Print Output from Windows Command Prompt to a Text File
  • Create A Batch File That Opens Applications You Choose From A List
  • Batch File To Open Multiple Programs At Once
  • Find Out which Program Has Locked A File
  • Change Default Wallpaper Directory In Windows
Categories: Tips 'n Tricks | Tags: Command Prompt, Tips 'n Tricks, Windows
Move the 'Menu Bar' Above 'Address Bar' in IE 8
Login Two Gmail accounts Simultaneously in the Same Browser with IE8

  • Get Updates via Email

  • Recent Posts

    • Android: Get Chat Heads-like Notifications for all Apps
    • CMS2CMS: Migrate Site from Drupal or Joomla to WordPress
    • WordPress: Add Preview Button in Distraction Free Writing
    • How to Activate or Deactivate Individual Jetpack Modules
    • Windows 8: Auto Update Defender with Windows Update Disabled
    • Automatically Start and Close Programs at Specific Time
  • Random Posts

    • Download Adobe Reader XI Offline Installer for Windows and Mac
    • Create Your Own Windows Transformation Pack with Skin Pack Installer System
    • Create a Bootable USB Ubuntu drive
    • Add & Easily Switch Keyboard Layout in Windows 7 & Windows 8
    • Mozilla Firefox Download Manager Tweaks
    • Switch Between Multiple Power Plans with Shortcut or Schedule
  • Categories

    • Blogging
    • Games
    • Google
    • How To?
    • Linux
    • Microsoft
      • Windows
    • Miscellaneous
    • Phone
    • Snippets
      • AutoHotkey Snippets
      • CSS Snippets
      • htaccess Snippets
      • JavaScript Snippets
      • PowerShell Snippets
      • WordPress Snippets
    • Social
    • Software
      • Browsers
    • Tips 'n Tricks
    • Wallpapers
    • Web
© SumTips. Contact | Sitemap | Privacy Policy