本帖最后由 pcl_test 于 2017-6-14 00:07 编辑
- @echo off
- powershell ^
- $list=@{};gc -LiteralPath '文本.txt'^|%%{^
- $line=$_.trim();^
- if($line){^
- $t=$line -split '(?^<=^^\S+)\s+';^
- $list[$t[0].toLower()]=$t[1];^
- }^
- };^
- dir . *.pdf -r^|?{$_ -is [System.IO.FileInfo]}^|%%{^
- if($list[$_.Name.toLower()]){^
- mv -LiteralPath $_.FullName ($_.DirectoryName+'\'+$list[$_.Name.toLower()]+$_.Extension);^
- }^
- }
- pause
复制代码
|