• Change file attributes on the command line. ATTRIB command to change file attributes

    Each folder or file is assigned the date and time of its creation, modification and last access, as well as file attributes. Sometimes it is necessary to change these values. Changing the date may be necessary when downloading files from the Internet and installing correct date, to hide the access time of certain resources, when editing files to return them to the correct date. File attributes define additional properties of files and sometimes it is necessary to change them; in particular, you may need to change the archive attribute after a backup. Limited Features to change the above properties is provided by the operating system, however if you need to change different properties for large quantities objects, for example, change file dates or folder attributes, then you cannot do without special programs.

    Attribute Changer 4.20

    Attribute Changer is a program for changing the properties of files and folders, including file attributes, date and time: creation, modification and access, as well as the compression attribute on NTFS. Attribute Changer is an Explorer extension. It is integrated into the shell of Windows 9x/NT/2000/XP operating systems (to install the program under Windows NT/2000/XP you must have administrator rights) and can only be called through the “Change attributes...” item. attributes") of the Explorer context menu, for which you first need to select the folders and/or files whose attributes you want to change. The program is also available for calling from the context menu for logical drives.

    The program interface is located on six tabs:

    The Folder Attrubutes tab is intended for setting folder attributes. You can give folders standard file attributes (in fact, folders are also files, with the directory attribute set). We can say that this is an almost unique opportunity, because... Very few programs allow you to change folder attributes.

    On the NFTS file system, you can also set the additional Compress and Index attributes. The Compress attribute is used to set/remove NTFS compression and in no way relates to archive files. The Index attribute is used under Windows 2000 to index files: all files with these attributes are added to a special database for later quick search these files.

    At the top is the number of selected folders that will be given the specified attributes if the Recurse folders flag (Including subfolders) is not selected, which serves to set attributes not only for the selected folders, but also for all the directories that are located in them. If no folder is selected, the Folder Attrubutes tab will not be shown.


    The File Attributes tab is used to set file attributes. For file system four are available based on FAT standard files s attributes: Read-only (Read-only), Archive (Archive), Hidden (Hidden), System (System), for NTFS - two more additional attributes, already familiar to us from the previous tab. The number of selected files is also indicated at the top. If you set the Recurse folders flag, then the specified attributes will be set to all files contained in the selected folders (if no folder is selected, this flag is not available).


    To change the date and/or time of files, you must select the corresponding Set Date to and/or Set Time to checkbox. To clarify regarding them additional parameters click the Advanced button, the additional window Advanced File Settings with two tabs for specifying Date and Time settings.

    If you set the Use date mask flag, you can tell the program to change not all date attributes, but only those specified by the Day, Month, Year flags.

    The Change "Created" date property, Change "Created" date property, and Change "Accessed" date property flags specify changes to the specified creation, modification, and last access dates.


    Similar to a date, using the Use time mask flag for a time attribute can only change the selected time attributes: Hour, Minutes, Seconds. Also, similar to the previous tab, changes in temporary attributes can be specified for the time of creation, modification and last access.


    The Filters and Exceptions tab is used to set additional conditions applied to the list of files and folders to change their attributes. The tab is divided into two halves; in the upper half you can set filters and exclusions for files, in the lower half - for folders. If the Use Filter flag is checked, then you can set a filter, and if Use Exception is checked, then you set an exception. Keep in mind that filters and exclusions for folders do not apply to the files within them. When specifying filters and exclusions, you can use the multiple replacement characters "*" and "?".


    The file filter consists of four tabs on which you can set various file properties. The Date tab specifies the date of the files whose attributes will be changed.


    You can specify a creation, modification, or access date before or after a specified date, or between specified dates.


    If you check the CorruptFiles only flag damaged files), then the filter will include files with the “wrong” date: before January 1, 1980 and after December 31, 2099. This feature only works on NT-compatible systems.

    The Time tab works in exactly the same way, only for setting the time.


    The Size tab allows you to set file size limits: smaller or larger than the specified one, including within the specified range.


    The Attributes tab allows you to change attributes and parameters only for files with a specified combination of attributes.


    The exclusion can be set in two ways: "Include all files, except" or "Exclude all files, except".


    The file mask is set in two ways: by dragging files into the window to set exceptions with the mouse, or by adding a file mask manually using the context menu.


    If you set the Group file extensions flag on the Options tab, then files added to the window are automatically converted into group masks by extension, for example, if you add the file "E:\Test\readme.txt", then the mask is automatically converted to "E:\Test\*.txt", otherwise the mask will be equal to the full path along with the name of the added file.

    The Activity and Result tab is used to display the full names of files and folders whose attributes are in at the moment change, as well as to display a list of objects whose attributes were changed when problems were encountered. If the program was unable to change the attributes of files or folders, they will be displayed in the list in a white window. Objects whose properties are currently being changed are shown at the bottom of the status bar.


    The Global Settings tab is used to set program settings. When the Folder attributes and File attributes flags are set, the program remembers the last used folder and file attributes. The installed flags File filter, File exception, Folder filter, Folder exception specify the storage of used filters and exceptions for files and folders. The Sort result list flag specifies remembering the sorting of the output of the results of attribute changes, and the Save windows position flag specifies storing the positions of program windows.


    Note: By default, all settings flags are enabled, which can be convenient for repeating similar changes.

    The specified changes in the attributes of the selected folders and files will take effect after clicking the Apply button; after execution, the program window does not close, but still remains on the screen, which makes it possible to apply the following transformation to the already selected folders and files. Thus, you can set complex combinations of attributes that cannot be set at once.

    For real useful opportunity program is to compress/decompress files in a file NTFS system under Windows NT/2000/XP. The program has an optimized algorithm for changing the attributes of even currently open files, but this is only possible for standard file attributes.

    Attribute Changer is compatible with Novell Netware. Attribute Changer was tested on computers running Novell Netware 4 and 5, where the program passed the test successfully. It should also work under Novell Netware 6 with NSS volumes.

    The Attribute Changer program is written in Borland Delphi and is completely free, including for commercial use. You can redistribute the program completely freely without making changes to it and preserving all the source files.

    What's new in Attribute Changer 4.20:

    Improved help system and added the ability to support the program interface in other languages ​​(unfortunately, the program will not have a Russian interface in the near future; the author refused the proposal to translate the program into Russian, stating that he does not plan such a translation yet);

    Bug fixed incorrect installation Compress and Index attributes on NTFS;

    The problem with focus in file and folder filters, as well as with “dragging” files with the mouse into the window to set exceptions, has been resolved.

    A description and screenshots of Attribute Changer 5.0 have already appeared on the program website.


    The main changes affected the graphic design and the movement of some program settings to another place, in particular, the filters and exclusions buttons were moved to the attribute modification tab. Time and date can now be changed relative to the existing one. Another significant improvement is writing a list of files and folders with changed attributes to a file. Coming soon new version the program will be available for download.

    Attribute Changer 4.20 (size 0.99Mb): link

    Attribute Magic Pro 2.0 beta 3

    Attribute Magic Pro is a program for changing the date and time of creation, modification and last access of files and folders, as well as changing their attributes. The program interface is similar to file manager. First, you need to go to the folder that contains the folders and/or files whose attributes and properties you need to change.


    Then you need to select necessary files and folders and select the desired item from the Edit menu or context menu.


    To change attributes, select Change Attributes.


    The number of files and folders (excluding subdirectories) that will be affected by the changes is indicated at the top. You must select whether the attribute change applies to folders, files, or both. The Process Subfolders flag also ensures that the specified attributes of the selected objects in all subfolders are changed. To change the four standard file attributes, you must select its value next to each attribute: Reset, Set, or Do not modify. If the Preview results flag is set, the actual attributes and their future values ​​will be shown before the final change.


    To accept these changes, simply click the Apply Changes button.

    To change the time parameters of selected objects, select Change Dates. Changing temporary attributes is largely similar to the previous one.


    In addition to working with regular files, the program has additional features on changing the temporary properties of documents Microsoft Office and digital photographs.


    In addition to standard files, the program also allows you to change properties Microsoft documents Office. To do this, select the menu item Change Document Summary. The following properties are available for modification: Title, Subject, Category, KeyWords ( Keywords), Template, Comments, Author, LastAuthor, AppName, Company, Created (Creation document date - may differ from the file creation date), Last Saved ( Date last save), Last Printed.


    To change the date and time of creation, modification and last access to separate files you can use free previous version programs - Attribute Magic 1.0.3.


    Attribute Magic Pro is designed to work under Windows 95/98/Me/NT4.0/2000/XP. A 15-day version of the program is available for download. The Attribute Magic Pro license costs $15.

    Attribute Magic 1.0.3 (size 363 Kb): link

    Attribute Magic Pro 2.0 beta 3 (size 780 Kb): link

    Note: Unfortunately, due to limitations imposed by operating systems Windows family 9x, you cannot set the date and time of creation, modification and access for folders; this is only possible under Windows NT/2000/XP.

    Today I would like to pay attention to what file attributes are and how to change file attributes. Before asking myself why I was drawn to such subtleties, let's do one small experiment. Ask someone you know (in ICQ, Skype, social network) one question - “File?”.

    You can write this in the chat window, by the way, if you don’t know how to install Skype, you can read the article: “”. So, I bet that in response to the question “File?”, 75% of people will answer “Which?”, hoping to get additional information about which file you are interested in. You can explain to your interlocutor in detail what exactly you meant. But in order for your computer’s operating system to receive such information, file attributes are used. Therefore, it will not be superfluous to pay attention to them.

    Why are file attributes needed?

    If you say in a simple way, then this is a parameter that tells the operating system to possible actions with the file.

    For each file there are four main parameters:

    • R –readonly (read-only)
    • S – system)
    • H – hidden)
    • A –archive (archive, requiring archiving)

    R –readonly . This parameter, which is translated into Russian as “read only,” is responsible for the potential for editing. If its value is “yes”, then any attempts to make changes will lead to nothing. The OS simply won't give you the opportunity to save them. This is very convenient if several users have access to a file, for example in the case shared files on the local network.

    S –system . This parameter clearly indicates to the OS that this file is a system file and its presence is required for stable operation applications or systems. Because having these files is critical when attempting to move or delete them, Windows will promptly ask you if you really want to do these operations.

    But, you must remember about the existence of viruses; if a file is marked as system, then this is not a reason to think that it is so.

    H –hidden . This parameter controls the visibility of the file by users. Typically, service or system files are hidden in order to reduce the risk of accidental deletion.

    A –archive . This option indicates that the file is in compressed form.

    As you can see, everything is quite simple. It is worth noting that attributes also exist in UNIX-like operating systems. I will not dwell on them because such operating systems are much less common and their users are probably aware of such information. Most likely you are also interested in the question:

    Changing attributes

    This can be done quite simply using the standard Windows Explorer. To do this, you need to select the file, open the context menu (it is activated by right-clicking) and select “Properties”.


    On the “General” tab we see two checkboxes that are responsible for assigning the main attributes “Read Only” and “Hidden”. You can set the required value by simply ticking the desired item.


    For example, you can anyone text document set the “Read Only” attribute. Open the document you just created and type any word. Did you manage to save it?

    By the way, it was precisely because of this situation that I decided to write an article. After all, many novice users do not understand what the catch is.

    If you continue your research, you can go to the “Advanced” subsection. It contains checkboxes for additional attributes that specify the need for archiving after editing, as well as the need to index the file for faster searching.

    As you can see, file attributes are quite simple and it’s not difficult to set them. I think I managed to convey to you information about what file attributes are.

    That's all for today. I will be glad to meet your comments 😉 .

    In any of the currently existing operating systems there is such a thing as file attributes. Attributes belong not only to folders, but also to files. To change information about a file, you often have to resort to attributes, for example, when changing the creation date of a file or completely editing it.

    You will need

    • Attribute Changer software.

    Instructions

  • Most operations with attributes can be done standard means operating system, but if a failure occurs in the file system or there is a need for a deeper change in file attributes, you can use special programs. At the moment, there are a large number of such programs. Conventionally, they can be divided into paid and free, easy to use and multifunctional. Which program to choose is a matter of taste.
  • With this program you can change the properties of files or folders, as well as any attribute of the file, including the time it was created and when it was modified. Attribute Changer is integrated into the Explorer context menu; the action of this program can be seen when you right-click on any object. After right-clicking, select Change attributes from the context menu. This action applies not only to one file or directory; if you select a group of files or several folders, you can perform the same action as described above.
  • In the window that opens, you will see 6 tabs, by the name of which you can determine the action of each of them. On the first Folder Attrubutes tab, you can change folder attributes. The number of selected folders is shown at the top of this tab. To set some attributes for subfolders, you need to check the box next to Recurse folders. All items that will come after the inscription Change attributes are intended for changing attributes.
  • On the next tab, File Attributes, you can change file attributes. Each file system implies the presence of certain attributes. In the operating room Windows system There are 2 main file systems: FAT32 and NTFS. For FAT32, 4 file attributes can be changed:
  • Read-only (read-only);

    Archive (archive);

    Hidden (hidden);

    System. For NTFS, 2 additional attributes are added:

    Compress (compression);

    Index: If you want to change the date or time the file was created, refer to Set Date to and Set Time to.

  • You have changed the attributes of files and folders, but there are still 4 tabs left, the purpose of which you do not know. To easily change attributes, you need to know how to use the first two tabs. The following tabs contain more complex elements, for example, creating additional conditions for files and folders, displaying the full names of files whose attributes are currently being changed, etc.
  • Tip added May 21, 2014 Tip 2: How to change file properties to Standard using Windows You can only change some properties of files, for example, allow editing and deletion. To change the creation date, you have to use third party programs or non-standard Windows techniques.
    How to hide a file Using standard Windows tools, you can hide a file you created from viewing and prevent it from being edited. To do this, right-click on its icon, select the “Properties” command and in the “General” tab of the properties window, check the “Read Only” and “Hidden” attributes. Then go to the “Tools” menu and check the “Folder Options” option. In the “View” tab, find the item “ Hidden folders and files" and set it to "Do not show". Click OK to confirm. To restore the file's visibility, uncheck the Hidden attribute. How to change file properties You can only change some of the information in a file's properties. If you have Windows XP installed, in the properties window, go to the “Summary” tab and click “Advanced”. Click in the "Value" section next to the property you want to change. If editing is enabled, an empty field will appear surrounded by a frame. To change the properties of a file in Windows 7, in the properties window, go to the “Details” tab and proceed as described above. How to change the creation date of a file To find out the creation date of a file, right-click on its icon and select the “Properties” command. The “General” tab displays basic information about the file, including the creation date. You cannot change this parameter using standard Windows tools, but you can use non-standard techniques. Double-click on the clock in the tray (lower right corner of the screen) and set the date and time to which you want to change the actual file data. Open the file with a suitable editor (Word is suitable for text files, Paint or Photoshop is suitable for graphic files) and save it under your name. Now the file properties will reflect the creation date you need. You can use third-party programs to change file attributes, for example, file Total manager Commander. Launch TC and find in Explorer the file whose information you want to change. In the “Files” menu, click “Change Attributes” and in the new window, check the box next to “Change date/time”. Then check the “Use plugins” checkbox. The Plugin field should contain the value tc. In the “Property” field, expand the drop-down list and select “Creation Date”. In the "Value" field, enter the desired date and click OK. For plausible adjustments, click “Add Attribute” and select “Modification Date” from the list of properties. Enter a date later than the creation date. In the same window, you can prohibit editing the file and make it hidden. To do this, check the “Read Only” and “Hidden” checkboxes. How to change file properties - printable version

    If you open properties of any file or directory, at the bottom of the properties window you can see two checkboxes: “Hidden” and “Read Only”. These settings are called attributes. Attributes- this is a certain set of parameters that indicate exactly how the operating system processes the file. Windows has five basic attribute types: Read-Only, Hidden, Archived, System, and Non-Indexed Content.

    View, install and remove attributes can be done both from Explorer (limited) and from the command line. Using the console has certain advantages, as it allows you to set the “System” attribute, which is not available in Explorer. The attrib command is responsible for working with object attributes in Windows. Its syntax is simple.

    ATTRIB [R] [A] [S] [H] [I] [path to object] ]

    Letters R, A, S, H, I set attribute, and the /S, /D, /L keys specify a set of parameters for processing. Keys are used primarily when processing a group of objects, such as nested files and directories. The signs “+” and “-” added before the parameter letter set and clear the attribute, respectively.

    attrib +r [path to object]
    attrib –r [path to object]

    Description of the main parameters

    The R option makes the file read-only. If you make changes to the file and then try to save it, the system will not allow you to do so. Instead, she will suggest saving it under a different name.

    attrib +r D:/files/text.txt

    Option A is the default for all files. It indicates that the file is ready for archiving. Removing or adding this attribute does not play any significant role in the operation of the operating system.

    Example:

    attrib -a D:/files/text.txt

    The H option hides the file or folder, making it invisible. Can be useful for hiding various objects in order to prevent access to them.

    Example:

    The first command will hide the text.txt file, the second will hide all objects in the files directory (including the directory itself).

    attrib +a D:/files/text.txt
    attrib +h D:/files/\»*\» /s /d

    Parameter S indicates Windows that the file needs to be processed as a system one. IN Windows such files have a special status. Can be installed by the user when performing various kinds of file system tweaks, for example, when enabling the function of displaying directory comments, which is not available in the OS by default. This attribute can only be set via the command line.

    Example:

    attrib +s D:/files/autorun.ini

    Note: If you set the file's System attribute and then try to make it hidden, the system will throw an error. In the same way, you cannot make a hidden file system. If you need the file to be both hidden and system, you need to set two attributes at once in one command.

    Example:

    attrib +s +h D:/files/text.txt


    Parameter I is used very rarely. If you don't want Windows to index the contents of a file, you can set the Unindexed Content attribute.

    Example:

    attrib +i D:/files/text.txt

    It should be noted that using the command line gives undeniable advantages when viewing the attributes of a group of files. In Explorer, to do this, you would have to open the properties of each file separately, but in the console, you just need to run the following command:

    attrib D:/files/\»*\» /s


    In this case, a list of all files in the files directory (including subfolders) will be displayed in the command line window, indicating their attributes. You can use redirection to retrieve attributes for a large number of files. For example, the command attrib d:/\»*\» d:/log.txt /s will process all files on drive D and output names with attributes to the text log log.txt.

    ATTRIB Team used to change the attributes of one or more files. In order to view the attributes of a file, you need to right-click on it and select properties. For example, let’s create on drive “C” text file"attribute.txt" Right-click on this file and select “Properties” from the context menu.

    Read-only file attribute prohibits changes to be made to it. If this attribute is set (there is a checkmark in the “Read Only” field), then the user can open this file and write information to it, but when trying to save, a message will appear that these actions require administrator rights. Although setting this attribute does not allow making changes to the file, this file can be deleted, copied, moved to another location, or renamed.
    File attribute "Hidden" Makes files invisible in Explorer. For example, if you set this attribute (check the “hidden” box), click “Apply” and “Ok”, the file will disappear from Explorer (become invisible). To display hidden files in Windows7, you can do the following: go to Explorer, click "Organize", then "Folder and Search Options", then "View". Here you need to check the “Show hidden files, folders and drives” option. Next, click “Apply” and “Ok”.

    The "System" attribute is automatically set by the operating system for all important system files Windows. It is impossible to change this attribute through the file properties, because there is no such field (this can be done via the command line). The “Hidden” attribute is automatically set for system files. To display system files in Windows 7, you can do the following: go to Explorer, click “Organize”, then “Folder and Search Options”, then “View”. Here you need to check the “Show hidden files, folders and drives” item and uncheck the “Show protected system files” item. Then click “Apply” and “Ok”.

    As a result, you will have several new files on drive “C” (IO.SYS, MSDOS.SYS, etc.). It is not recommended to enable the display of system and hidden files and folders, because There is a high risk of moving or deleting an important file.

    When you click on the “Other” button in the file properties, a window will open additional attributes.

    Archive attribute is set in the “File ready for archiving” item. If this item is checked (as in the figure below), then this file has an archive attribute. The archive attribute is required to create a backup copy of the file when archiving. If the attribute is set, the backup program will create a copy of this file and reset the attribute. Accordingly, at the next backup copy of this file will not be done because the archive attribute is reset, which means the file has already been backed up. However, if you make changes to this file, the operating system will automatically set the archive attribute so that the next time you back up, a copy of this file will be made.

    "Indexation" attribute. Above the “File is ready for archiving” option is the option “Allow the contents of this file to be indexed in addition to the file properties.” By default, this attribute is set for all files. Indexing is necessary to quickly find the files you need on your computer. When indexing, the operating system creates special files, where the index is entered. When searching the desired file it is not searched on the hard drive, but in the index. operating system constantly (in background) indexes the most common files.
    Attribute "Compress content to save disk space" necessary for compressing files and folders. Setting this attribute works similarly to various archivers (for example, WinRaR). Compression using the attribute does not require unpacking files when working with them, however, the compression rate is not as high as that of archivers. The names of files and folders that have this attribute set are highlighted in blue. When you set this attribute on a folder, you will be asked to apply compression only to the folder, or to the folder and all its subfolders.

    The compression quality can be viewed in the “properties” of the folder, where the folder size and how much space will be indicated this folder occupies disk space.

    Attribute "Encrypt content to protect data" allows you to encrypt a file or folder. When this attribute is set, the file or folder will only be accessible to the user who is logged in with account, at which the attribute was set. Other users will not be able to view encrypted folders and files if they do not have the password. The password is created during the first encryption. Windows will prompt you to create backups your encryption certificate and encryption key. You will need them if you log in with a different account. To access encrypted folders and files, you will need to enter a password. If you move an unencrypted file to an encrypted folder, it will automatically be encrypted. All encrypted folders and files are highlighted in green.

    ATTRIB Team makes it possible to change file attributes via the command line. The command has the syntax: ATTRIB [-A][+A][-S][+S][-R][+R][-H][+H][-I][+I] [Disk:][ Path][File name]. The letters A, S, R, H, I respectively mean: archived, system, read-only, hidden, non-indexed content. The “+” and “-” signs mean setting and removing the attribute, respectively.

    For example, it will create a file “atribut.txt” on drive “C”. By default, when this file is created, only the archive attribute and the “indexing” attribute are set. Let's change the attributes of this file by setting the “Read Only” attribute and removing the “archive” attribute: attrib +r –a atribut.txt

    As a result, the file “atribut.txt” will have its archive attribute removed and the “Read Only” attribute set.
    The /S switch of the ATTRIB command indicates that file attributes are changed not only in the specified directory, but also in all subdirectories. For example, let’s create a folder “atribut” on drive “D”, inside this folder we will create two more folders “atribut1” and “atribut2”. In each of these folders we will create several files. Then the team attrib +r -a d:\atribut\*.* /s will change the attributes of all files located in the “atribut” directory and its subdirectories “atribut1” and “atribut2”.

    The ATTRIB command applies not only to files, but also to directories. For example, the command attrib +h d:\atribut will set the "Hidden" attribute for the "atribut" folder.