我正在执行下面的脚本,但它不工作,因为中间有空格。下面是脚本:
move C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg D:\Archive\
我们如何消除中间的空格并确保系统能够理解,以便将所有 jpg 文件移动到 D:\Archive
问候,轨道
在文件名周围加上引号。这向命令行解析器表明引号之间的所有内容都是单个标记
move "C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg" "D:\Archive\"
将长文件名用双引号括起来。
move "C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg" "D:\Archive\"
有关更多 DOS 批处理文件命令和语法,http://www.dostips.com/有一个很好的列表和大量示例。
作为替代方案,您可以使用 8.3 表示并删除空格(尽管我更喜欢引号和空格)。
move C:\abc\d\System Table\Table Six (Top)\LogFiles*.jpg D:\Archive\
move C:\abc\d\System~1\Tables~1\LogFiles*.jpg D:\Archive\
如果您有其他类似命名的目录,则~?
可能会有所不同。