【问题标题】:Move files to folders with same name in Windows在 Windows 中将文件移动到同名文件夹
【发布时间】:2018-07-05 20:55:06
【问题描述】:

我使用以下命令将文件复制到同名文件夹。

for /f %x in ('dir /ad /b') do move %x*.* %x\

我使用move %x*.* %x\ 将文件移动到给定目录。它不适用于文件名中有空格但不确定要更改什么的文件。

【问题讨论】:

  • 我尝试 for /f %x in ('dir /ad /b') do move "%x*.* %x"\ ,但我收到语法错误消息并且文件未移动。

标签: windows command-prompt file-handling


【解决方案1】:

此命令使用“DELIMS=”来防止分裂。

for /f "DELIMS=" %x in ('dir /ad /b') do move "%x*.*" "%x\"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-13
    • 1970-01-01
    • 2018-08-12
    • 1970-01-01
    • 2019-07-11
    • 2020-05-02
    • 2023-03-17
    相关资源
    最近更新 更多