入门命令11

您所在的位置:网站首页 windows移动文件到指定文件夹 入门命令11

入门命令11

2024-04-21 20:15| 来源: 网络整理| 查看: 265

move的意思不解释了  它可以用来移动文件(夹)或者对移动文件(夹)时重命名.

1 C:\DOCUME~1\DOUPI>move /? 2 Moves files and renames files and directories. 3 4 To move one or more files: 5 MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination 6 7 To rename a directory: 8 MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2 9 10 [drive:][path]filename1 Specifies the location and name of the file11 or files you want to move.12 destination Specifies the new location of the file. Destination13 can consist of a drive letter and colon, a14 directory name, or a combination. If you are moving15 only one file, you can also include a filename if16 you want to rename the file when you move it.17 [drive:][path]dirname1 Specifies the directory you want to rename.18 dirname2 Specifies the new name of the directory.

用这个命令有几个注意点,来看几个例子.

1. 基本移动文件(夹),在win平台,但它不能跨驱动器移动文件夹.

1 E:\>md aa bb\bbb cc 2 E:\>copy con aa\test1.txt 3 this is test11111^Z 4 已复制 1 个文件。 5 6 rem 移动文件到文件夹 7 E:\>move aa\test1.txt cc\ 8 rem 移动一个文件夹到另一文件夹,带了\,,,移动失败!?? 9 E:\>move bb\ cc\10 系统找不到指定的文件。11 rem 再来一次,成功12 E:\>move bb cc\13 14 rem 跨驱动器移动文件,成功.15 E:\>move cc\test1.txt d:\16 E:\>dir d:\test1.txt17 驱动器 D 中的卷是 SOFT18 卷的序列号是 6C97-9E4419 d:\ 的目录20 2011-12-12 10:49 17 test1.txt21 1 个文件 17 字节22 0 个目录 133,784,256,512 可用字节23 rem 跨驱动器移动文件夹,失败24 E:\>move cc\bb d:\25 拒绝访问。

2.重命名功能

1 rem 移动文件时进行重命名 2 E:\>move d:\test1.txt e:\cc\test2.txt 3 4 rem 如果第二参数为已存在的文件夹,则是移动操作 5 E:\>move aa cc 6 E:\>cd cc 7 E:\cc>dir 8 驱动器 E 中的卷是 TEST 9 卷的序列号是 EC10-1C7910 E:\cc 的目录11 2011-12-12 10:59 .12 2011-12-12 10:59 ..13 2011-12-12 10:50 aa14 2011-12-12 10:49 bb15 2011-12-12 10:49 17 test2.txt16 1 个文件 17 字节17 4 个目录 131,208,916,992 可用字节18 rem 当第二参数为不存在的文件夹,刚是重命名文件夹操作19 E:\cc>move bb cc20 移动了 1 个文件。

3.其他注意

1 E:\cc>copy test2.txt aa\ 2 已复制 1 个文件。 3 rem 移动文件时覆盖会自动提示 4 E:\cc>move test2.txt aa\ 5 改写 E:\cc\aa\test2.txt 吗? (Yes/No/All): y 6 7 E:\cc>copy aa\test2.txt . 8 已复制 1 个文件。 9 rem /y参数即可去掉覆盖提示,这个与其他命令是一样的. cmd中默认为-y,bat中默认为y,这点要注意10 E:\cc>move /y aa\test2.txt .11 12 rem 对具有隐藏属性的文件(夹)无法操作13 E:\cc>attrib +h test2.txt14 E:\cc>move test2.txt test1.txt15 系统找不到指定的文件。

 

OK,此篇完结.

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3