PowerShell Copy and Rename Files in the same Folder -


i have bunch of file copy or duplicate in same folder renaming part of filename during copying...

ex. copying these files

¸Ó¸®30_³²_0.pal ¸Ó¸®30_³²_1.pal ¸Ó¸®30_³²_2.pal ¸Ó¸®30_³²_3.pal ¸Ó¸®30_³²_10.pal ¸Ó¸®30_³²_11.pal ¸Ó¸®30_³²_12.pal 

but must renamed these

¸Ó¸®31_³²_0.pal ¸Ó¸®31_³²_1.pal ¸Ó¸®31_³²_2.pal ¸Ó¸®31_³²_3.pal ¸Ó¸®31_³²_10.pal ¸Ó¸®31_³²_11.pal ¸Ó¸®31_³²_12.pal 

also want input of copy , renamed to... need input 30_ files copy input 31_ or 41_ copied files..

if it's not possible input.. can hard coded value...

update:

i found code copies , renames files..

get-childitem '*30_*.pal' -recurs | % {    $copyto = $_.fullname -replace "30_","41_"    copy-item $_.fullname $copyto } 

the input what's missing now.. , don't know how it...

this should replace each file if get-childitem working properly

get-childitem '*30_*.pal' -recurse |% {$_.replace('30','31')} 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -