C# ASP.NET SQL SERVER

Powershell renaming filenames

One of the problems that I frequently come across is the need to rename a bunch of files according to a certain pattern which involves numbers. Now I still haven't figured out how to do that yet but I've just seen a Powershell Blog post Managing Datacenter Machine Names that gives me enough information to work it out - I think.

The cool new feature that I've just discovered is the range operator in Powershell:

1..5

Will generate the numbers 1 through 5. Pipe this into your command and use some .NET formatting and you can get zero padded numbers to help rename, copy, move, delete files that will save a lot of time on large folders of files.

» Similar Posts

  1. Powershell Ripped Media Renaming Script
  2. Deployed ASP.NET MVC app gives 404 on About Page
  3. Unit Testing Saves the Day

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://guyellisrocks.com/trackback.ashx?id=10

» Comments

    There are no comments. Kick things off by filling out the form below.

» Leave a Comment