批处理 中的 COPY函数

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

此批处理命令用于将文件从一个位置复制到另一位置。

COPY - 语法

Copy [source] [destination]

文件将从源复制到目标位置。

无涯教程网

COPY - 示例

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

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

来源:LearnFk无涯教程网

@echo off
cd
Rem Copies lists.txt to the present working directory.
If there is no destination identified , it defaults to the present working directory.
copy c:\lists.txt
Rem The file lists.txt will be copied from C:\to C:\tp location
copy C:\lists.txt c:\tp
Rem Quotation marks are required if the file name contains spaces
copy C:\My File.txt
Rem Copies all the files in F drive which have the txt file extension to the
current working directory copy
F:\*.txt
Rem Copies all files from dirA to dirB. Note that directories nested in dirA will not be copied
copy C:\dirA dirB

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

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

技术教程推荐

朱赟的技术管理课 -〔朱赟〕

如何设计一个秒杀系统 -〔许令波〕

Vue开发实战 -〔唐金州〕

检索技术核心20讲 -〔陈东〕

如何讲好一堂课 -〔薛雨〕

HarmonyOS快速入门与实战 -〔QCon+案例研习社〕

手把手带你搭建秒杀系统 -〔佘志东〕

eBPF核心技术与实战 -〔倪朋飞〕

运维监控系统实战笔记 -〔秦晓辉〕

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