Forgot password?
 Create new account
View 168|Reply 1

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

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2022-9-25 02:22:42 |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

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

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

手机版Mobile version|Leisure Math Forum

2025-4-20 22:11 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list