批处理 中的 CD函数

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

此批处理命令有助于更改其他目录或显示当前目录。

CD - 语法

cd

CD - 示例

以下示例显示了如何以多种方式使用cd命令。

@echo off
Rem The cd without any parameters is used to display the current working directory
cd
Rem Changing the path to Program Files
cd\Program Files
cd
Rem Changing the path to Program Files
cd %USERPROFILE%
cd
Rem Changing to the parent directory
cd..
cd
Rem Changing to the parent directory two levels up
cd..\..
cd

更改到各个文件夹位置后,以上命令将显示以下输出。

无涯教程网

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

来源:LearnFk无涯教程网

C:\Users\Administrator
C:\Program Files
C:\Users\Administrator
C:\Users
C:\

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

技术教程推荐

微服务架构实战160讲 -〔杨波〕

玩转Git三剑客 -〔苏玲〕

深入浅出计算机组成原理 -〔徐文浩〕

编译原理之美 -〔宫文学〕

苏杰的产品创新课 -〔苏杰〕

性能测试实战30讲 -〔高楼〕

去无方向的信 -〔小麥〕

零基础学Python(2023版) -〔尹会生〕

后端工程师的高阶面经 -〔邓明〕

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