批处理 中的 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:\

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

技术教程推荐

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

从0开发一款iOS App -〔朱德权〕

消息队列高手课 -〔李玥〕

后端技术面试 38 讲 -〔李智慧〕

Java业务开发常见错误100例 -〔朱晔〕

PyTorch深度学习实战 -〔方远〕

Serverless进阶实战课 -〔静远〕

超级访谈:对话毕玄 -〔毕玄〕

手把手带你写一个MiniSpring -〔郭屹〕

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