Windows Vista Forums

Rename all folder names to lowercase

  1. #1


    Anna Guest

    Rename all folder names to lowercase

    How to rename all folder names to lowercase.
    All examples found with google faild.

    Anna





      My System SpecsSystem Spec

  2. #2


    Chris Dent Guest

    Re: Rename all folder names to lowercase


    Hi Anna,

    Windows doesn't do case sensitive names so you must go through an
    intermediate name.

    For example...

    # Get all folders in the current folder containing upper-case
    # characters in the name
    Get-ChildItem | ?{ $_.PsIsContainer -And $_.Name -CMatch "[A-Z]" } | %{
    # Get the lower case version of the name
    $Name = $_.Name.ToLower()
    # Rename the item to a temporary name, using PassThru to return
    # the renamed item
    $TempItem = Rename-Item -Path $_.FullName -NewName "$($Name)-Temp"
    -PassThru
    # Final rename to make the name entirely lower case
    Rename-Item -Path $TempItem.FullName -NewName $Name
    }

    Anna wrote:

    > How to rename all folder names to lowercase.
    > All examples found with google faild.
    >
    > Anna
    >
    >

      My System SpecsSystem Spec

  3. #3


    Anna Guest

    Re: Rename all folder names to lowercase

    Thx !

    Anna

    "Chris Dent" <chris@newsgroup> wrote in message
    news:OTv%23lRSlKHA.2160@newsgroup

    >
    > Hi Anna,
    >
    > Windows doesn't do case sensitive names so you must go through an
    > intermediate name.
    >
    > For example...
    >
    > # Get all folders in the current folder containing upper-case
    > # characters in the name
    > Get-ChildItem | ?{ $_.PsIsContainer -And $_.Name -CMatch "[A-Z]" } | %{
    > # Get the lower case version of the name
    > $Name = $_.Name.ToLower()
    > # Rename the item to a temporary name, using PassThru to return
    > # the renamed item
    > $TempItem = Rename-Item -Path $_.FullName -NewName
    > "$($Name)-Temp" -PassThru
    > # Final rename to make the name entirely lower case
    > Rename-Item -Path $TempItem.FullName -NewName $Name
    > }
    >
    > Anna wrote:

    >> How to rename all folder names to lowercase.
    >> All examples found with google faild.
    >>
    >> Anna


      My System SpecsSystem Spec

Rename all folder names to lowercase

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved Could not rename the folder name smuralii General Discussion 7 09 Aug 2009
file names and folder names have been changed into some values automatically harish9999 Vista file management 3 30 Nov 2008
Cannot Rename a New Folder ianc1505 Vista General 1 21 Jun 2008
can not rename any folder Incognito Vista General 5 21 May 2008
Typewriting lowercase after uppercase letters quickly Erhard Glueck Vista performance & maintenance 7 10 Jan 2008