批处理 中的 RD函数

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

此批处理命令将删除目录,但是目录必须为空才能删除。

RD - 语法

rd [directoryname]

RD - 示例

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

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

来源:LearnFk无涯教程网

@echo off
Rem removes the directory called newdir
rd C:\newdir

Rem removes 2 directories
rd Dir1 Dir2

Rem Removes directory with spaces
rd "Application A"

Rem Removes the directory Dir1 including all the files and subdirectories in it rd /s Dir1
Rem Removes the directory Dir1 including all the files and subdirectories in it but
asks for a user confirmation first.
rd /q /s Dir1

所有操作均按照批处理文件中的备注执行。

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

技术教程推荐

人工智能基础课 -〔王天一〕

硅谷产品实战36讲 -〔曲晓音〕

小马哥讲Spring核心编程思想 -〔小马哥〕

Selenium自动化测试实战 -〔郭宏志〕

实用密码学 -〔范学雷〕

陈天 · Rust 编程第一课 -〔陈天〕

零基础入门Spark -〔吴磊〕

Dubbo源码剖析与实战 -〔何辉〕

B端体验设计入门课 -〔林远宏(汤圆)〕

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