找回密码
 快速注册
搜索
查看: 65|回复: 1

[Windows命令行] 路径分隔符 斜杠、反斜杠

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2022-9-25 02:22 |阅读模式
用“del ...”时只能用反斜杠 Screenshot 2022-09-24 at 14-49-47 complex.pdf.png
用“explorer ...”时两者均可 Screenshot 2022-09-24 at 14-49-47 complex.pdf.png


用“move ...”时也只能用反斜杠
为了把“屏幕截图”里面的所有扩展名为png的文件
移动到“Saved Pictures”里面
  1. move "屏幕截图/*.png" "Saved Pictures"
复制代码

显示:
A duplicate file name exists, or the file cannot be found.
换成反斜杠再试下:
  1. move "屏幕截图\*.png" "Saved Pictures"
复制代码

显示:
D:\onedrive\OneDrive - Nexus365\图片\屏幕截图\Screenshot (2).png
        1 file(s) moved.

成功了


PS:
复制文件路径(Copy as Path)的快捷键为Ctrl+Shift+C

Windows Command Line

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2022-9-25 02:53
“explorer(文件资源管理器)”是外部程序,不属于Windows命令,而Windows命令都是只能使用反斜杠作为路径分隔符

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 15:47

Powered by Discuz!

× 快速回复 返回顶部 返回列表