i've created batch file move files on 30 days old archive folder. append string of text end of files moved. here have moving files older 30 days:
robocopy "c:\...\data" "c:\...\archives" /move /minage:30 that part working great. advice on best way add string of text such "xyz" end? i.e. datafile_xyz.txt
thank in advance help!
this accomplished one-line powershell command:
powershell "get-childitem c:\...\archives\*.* | where-object {$_.name -notlike '"*_xyz.*'"} | foreach-object {rename-item -path $_.fullname -newname ($_.name -replace '\.', '_xyz.')}"
Comments
Post a Comment