Monthly Archives: September 2015

Batch Renaming Files in Powershell

I needed to rename a number of files, and include a number at the end.  eg:

Rename the following files:

IMG_20140725_143539.jpg
IMG_20140816_130503.jpg
IMG_20140816_130511.jpg
IMG_20140816_130513.jpg
IMG_20140818_143330.jpg
IMG_20140818_143331.jpg
IMG_20140818_143337.jpg
IMG_20140818_143357.jpg
IMG_20140818_143721.jpg
IMG_20140908_144527.jpg
IMG_20140908_144543.jpg
IMG_20140908_144549.jpg
IMG_20140909_070841.jpg
IMG_20140909_070849.jpg
IMG_20140909_111920.jpg
IMG_20140909_111927.jpg
IMG_20140909_122855.jpg
IMG_20140909_122910.jpg
IMG_20140909_122935.jpg
IMG_20140909_122945.jpg
IMG_20140909_122950.jpg
IMG_20140909_122953.jpg
IMG_20140909_123106.jpg
IMG_20140909_123115.jpg

 
to

stormpic01.jpg
stormpic02.jpg
stormpic03.jpg
stormpic04.jpg
stormpic05.jpg
stormpic06.jpg
stormpic07.jpg
stormpic08.jpg
stormpic09.jpg
stormpic10.jpg
stormpic11.jpg
stormpic12.jpg
stormpic13.jpg
stormpic14.jpg
stormpic15.jpg
stormpic16.jpg
stormpic17.jpg
stormpic18.jpg
stormpic19.jpg
stormpic20.jpg
stormpic21.jpg
stormpic22.jpg
stormpic23.jpg
stormpic24.jpg

I created a powershell script to do this, available here: http://pastebin.com/kTUyivgA

I used the command:

.renamefiles.ps1 -filepath c:temprenfile -renameto stormpic -leadingzeros $true
 

RANT – Having to second guess software installations


I’m putting this here because it will help me remember to make this change everytime, given this is now classified as ‘WONTFIX’

http://betanews.com/2015/08/15/firefox-stealthily-loads-webpages-when-you-hover-over-links-heres-how-to-stop-it/

about:config
network.http.speculative-parallel-limit

I found out about this from the patchmanagement.org mailing listhttp://patchmanagement.org/