Windows Vista Forums

Problem with renaming files !
  1. #1


    Ahmed Sobhi Guest

    Problem with renaming files !

    I don't know but if there's no clear explanation for this then this might be
    a bug.

    the problem is I'm trying to rename a file that has the square brackets in
    its name, it's named '[Cover.jpg]' without the quotes ofcourse.

    I used TAB for autocompleting the filename to construct the following
    command

    Rename-Item '`[Cover`].jpg Cover.jpg

    Apparently it used ` as an escape sequence. Anyway, I get the following
    error

    Rename-Item : An Object at the specified path H:\Test\`[Cover`].jpg does not
    exist



    I even tried to remove the escape character but I still get the same error!

    What's wrong?


      My System SpecsSystem Spec

  2. #2


    /\/\o\/\/ [MVP] Guest

    RE: Problem with renaming files !

    In PowerShell 1.0 RTM you need to use double quotes to avaluate escaping :

    PoSH> '`[Cover`]'
    `[Cover`]
    PoSH> "`[Cover`]"
    [Cover]

    (Seem's the tabcompletion is not updated for this.)

    Greetings /\/\o\/\/

    "Ahmed Sobhi" wrote:

    > I don't know but if there's no clear explanation for this then this might be
    > a bug.
    >
    > the problem is I'm trying to rename a file that has the square brackets in
    > its name, it's named '[Cover.jpg]' without the quotes ofcourse.
    >
    > I used TAB for autocompleting the filename to construct the following
    > command
    >
    > Rename-Item '`[Cover`].jpg Cover.jpg
    >
    > Apparently it used ` as an escape sequence. Anyway, I get the following
    > error
    >
    > Rename-Item : An Object at the specified path H:\Test\`[Cover`].jpg does not
    > exist
    >
    > I even tried to remove the escape character but I still get the same error!
    >
    > What's wrong?
    >


      My System SpecsSystem Spec

Problem with renaming files ! problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Renaming Multiple Files in Vista Quco Vista General 4 10 Jan 2010
Help with renaming files Kipmix PowerShell 0 24 Jul 2009
renaming files problem.. maya Vista General 4 23 Jan 2008
Renaming Files phil237 Vista General 5 29 Aug 2007
Renaming Files Quco Vista General 0 02 May 2007