- Batch Script Tutorial
- Batch Script - Home
- Batch Script - Overview
- Batch Script - Environment
- Batch Script - Commands
- Batch Script - Files
- Batch Script - Syntax
- Batch Script - Variables
- Batch Script - Comments
- Batch Script - Strings
- Batch Script - Arrays
- Batch Script - Decision Making
- Batch Script - Operators
- Batch Script - DATE & TIME
- Batch Script - Input / Output
- Batch Script - Return Code
- Batch Script - Functions
- Batch Script - Process
- Batch Script - Aliases
- Batch Script - Devices
- Batch Script - Registry
- Batch Script - Network
- Batch Script - Printing
- Batch Script - Debugging
- Batch Script - Logging
- Batch Script Resources
- Batch Script - Quick Guide
- Batch Script - Useful Resources
- Batch Script - Discussion
Batch Script - ATTRIB
Displays or sets the attributes of the files in the current directory
Syntax
attrib
Example
The following example shows the different variants of the attrib command.
@echo off Rem Displays the attribites of the file in the current directory Attrib Rem Displays the attributes of the file lists.txt attrib C:\tp\lists.txt Rem Adds the "Read-only" attribute to the file. attrib +r C:\tp\lists.txt Attrib C:\tp\lists.txt Rem Removes the "Archived" attribute from the file attrib -a C:\tp\lists.txt Attrib C:\tp\lists.txt
Output
For example,
A C:\tp\assoclst.txt A C:\tp\List.cmd A C:\tp\lists.txt A C:\tp\listsA.txt A C:\tp\lists.txt A R C:\tp\lists.txt R C:\tp\lists.txt
batch_script_commands.htm
Advertisements