本帖最后由 newswan 于 2021-5-7 10:26 编辑
- PowerShell "$dt=(get-Date).ToString('_MM-dd_HH-mm'); dir _* | ?{($_ -is [IO.FileInfo] -and $_.Extension -eq '.txt') -or $_ -is [IO.DirectoryInfo]} | ren -NewName {($_.BaseName -replace '(?>(.\d\d)+)$') + $dt + $_.Extension}"
复制代码 那一句就是 重命名 三部分
($_.BaseName -replace '(?>(.\d\d)+)$')
$dt
$_.Extension |