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. Windows Home Server - the good and bad
  2. Combine, compress, and update your CSS file in ASP.NET MVC
  3. Get Powershell Version Number

» 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