Forgot password
 Register account
View 271|Reply 1

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

[Copy link]

3211

Threads

7832

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-9-25 02:22 |Read mode
用“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"
Copy the Code
显示:
A duplicate file name exists, or the file cannot be found.
换成反斜杠再试下:
  1. move "屏幕截图\*.png" "Saved Pictures"
Copy the Code
显示:
D:\onedrive\OneDrive - Nexus365\图片\屏幕截图\Screenshot (2).png
        1 file(s) moved.

成功了


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

Windows Command Line

3211

Threads

7832

Posts

52

Reputation

Show all posts

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

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-20 05:48 GMT+8

Powered by Discuz!

Processed in 0.014391 seconds, 30 queries