批处理 中的 ATTRIB函数

首页 / 批处理入门教程 / 批处理 中的 ATTRIB函数

显示或设置当前目录中文件的属性

ATTRIB - 语法

attrib

ATTRIB - 示例

以下示例显示了attrib命令的不同变体。

无涯教程网

@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

运行上面代码输出

链接:https://www.learnfk.comhttps://www.learnfk.com/batch-script/batch-script-attrib.html

来源:LearnFk无涯教程网

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

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

iOS开发高手课 -〔戴铭〕

OpenResty从入门到实战 -〔温铭〕

透视HTTP协议 -〔罗剑锋(Chrono)〕

Service Mesh实战 -〔马若飞〕

编译原理实战课 -〔宫文学〕

程序员的测试课 -〔郑晔〕

编程高手必学的内存知识 -〔海纳〕

商业思维案例笔记 -〔曹雄峰〕

手把手带你搭建推荐系统 -〔黄鸿波〕

好记忆不如烂笔头。留下您的足迹吧 :)