[string]$FileName="E:\test11"

#--------------------------------------
Clear-Host
foreach($f in Get-ChildItem -Path $FileName -Recurse)
{
    if($f.Attributes -eq "Archive")
    {    
        $OldName=$f.get_FullName()
        $NewName=$f.get_Directory().Name+"."+$f.Name.Split(".")[-2]+"."+$f.Name.Split(".")[-1]
        Rename-Item -Path $OldName -NewName $NewName
        write-host $OldName " --> " $NewName

    }    
}

 

 

 

PowerShell实现批量重命名文件

相关文章:

  • 2022-01-15
  • 2021-08-09
  • 2021-12-02
  • 2021-05-29
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2021-11-29
  • 2021-08-12
  • 2021-12-10
  • 2021-04-22
相关资源
相似解决方案