[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. #&cls&@cd /d "%~dp0" & powershell -c "Get-Content '%~0' | Out-String | Invoke-Expression " & pause&exit
  2. cls
  3. #变量设置
  4. $txt_file = 'b.txt'
  5. $src_dir = 'D:\A\rar'
  6. $dest_dir = 'D:\123'
  7. New-Item -ItemType Directory -Path @($src_dir,$dest_dir) -ErrorAction SilentlyContinue
  8. #读取列表
  9. $tag_arr = Get-Content -Path $txt_file -Encoding UTF8
  10. #移动
  11. Get-ChildItem -Path $src_dir | Where-Object { !$_.PsIsContainer -and $tag_arr -contains $_.Name } | foreach {
  12.     Move-Item -LiteralPath $_.FullName -Destination $dest_dir
  13. }
复制代码
1

评分人数

TOP

返回列表