Results 1 to 3 of 3

Thread: Command Line Ren (Rename) command broken?

  1. #1
    SixSigmaGuy Guest

    Command Line Ren (Rename) command broken?

    I'm having trouble with the REN command with wild cards as used from the command prompt.

    For example, in the REN command help, it says:

    "For example, if you had files that are named smitha.doc, smithb.doc, and smithc.doc, you could use the ren smith*.doc smythe*.doc command. All file names automatically show the new spelling, and are renamed smythea.doc, smytheb.doc, and smythec.doc."

    If I try the example, exactly as described, I don't end up with smythea.doc, smytheb.doc, and smythec.doc.

    Instead, when I create three files named smitha.doc, smithb.doc, and smithc.doc and then execute the command:

    ren smith*.doc smythe*.doc

    I get:

    C:\TestREN>ren smith*.doc smythe*.doc
    A duplicate file name exists, or the file
    cannot be found.
    A duplicate file name exists, or the file
    cannot be found.

    C:\TestREN>dir
    Volume in drive C is OS
    Volume Serial Number is 0A07-21F5

    Directory of C:\TestREN

    05/17/2008 04:04 PM <DIR> .
    05/17/2008 04:04 PM <DIR> ..
    05/17/2008 04:03 PM 0 Smithb.doc
    05/17/2008 04:03 PM 0 Smithc.doc
    05/17/2008 04:03 PM 0 smythe.doc
    0 File(s) 0 bytes
    2 Dir(s) 48,010,428,416 bytes free

    C:\TestREN>

    This isn't how I recall REN working in previous versions of Windows. Anyone know if the REN command has changed or been broken?

  2. #2
    Rick Rogers Guest

    Re: Command Line Ren (Rename) command broken?

    Hi,

    Works fine for me here. Looking at your DIR results, it appears the wildcard
    character, "a", wasn't carried on the first one. I just replicated your test
    and here are the results:

    Directory of C:\TestREN

    05/17/2008 09:11 PM <DIR> .
    05/17/2008 09:11 PM <DIR> ..
    05/17/2008 09:11 PM 9,863 Test1.docx
    05/17/2008 09:11 PM 9,887 Test2.docx
    05/17/2008 09:11 PM 9,895 Test3.docx
    3 File(s) 29,645 bytes
    2 Dir(s) 77,118,971,904 bytes free

    C:\TestREN>ren test*.docx work*.docx

    C:\TestREN>dir
    Volume in drive C has no label.
    Volume Serial Number is 2176-638D

    Directory of C:\TestREN

    05/17/2008 09:12 PM <DIR> .
    05/17/2008 09:12 PM <DIR> ..
    05/17/2008 09:11 PM 9,863 work1.docx
    05/17/2008 09:11 PM 9,887 work2.docx
    05/17/2008 09:11 PM 9,895 work3.docx
    3 File(s) 29,645 bytes
    2 Dir(s) 77,118,185,472 bytes free

    I'm having trouble with the REN command with wild cards as used from the
    command prompt.

    For example, in the REN command help, it says:

    "For example, if you had files that are named smitha.doc, smithb.doc, and
    smithc.doc, you could use the ren smith*.doc smythe*.doc command. All file
    names automatically show the new spelling, and are renamed smythea.doc,
    smytheb.doc, and smythec.doc."

    If I try the example, exactly as described, I don't end up with smythea.doc,
    smytheb.doc, and smythec.doc.

    Instead, when I create three files named smitha.doc, smithb.doc, and
    smithc.doc and then execute the command:

    ren smith*.doc smythe*.doc

    I get:

    C:\TestREN>ren smith*.doc smythe*.doc
    A duplicate file name exists, or the file
    cannot be found.
    A duplicate file name exists, or the file
    cannot be found.

    C:\TestREN>dir
    Volume in drive C is OS
    Volume Serial Number is 0A07-21F5

    Directory of C:\TestREN

    05/17/2008 04:04 PM <DIR> .
    05/17/2008 04:04 PM <DIR> ..
    05/17/2008 04:03 PM 0 Smithb.doc
    05/17/2008 04:03 PM 0 Smithc.doc
    05/17/2008 04:03 PM 0 smythe.doc
    0 File(s) 0 bytes
    2 Dir(s) 48,010,428,416 bytes free

    C:\TestREN>

    This isn't how I recall REN working in previous versions of Windows. Anyone
    know if the REN command has changed or been broken?

  3. #3
    SixSigmaGuy Guest
    Your test didn't test the same thing. You had 5 character filenames before
    and after the rename, i.e., the lenght of the filename didn't change. In
    the case described in help, they renamed 6 character filenames to 7
    character filenames. It should have worked as they described, but it
    didn't. Try the test again, renaming SMITH?.DOC to SMYTHE?.doc. It used to
    work fine; now it doesn't.

Similar Threads

  1. xcopy command line together with wmplayer command line
    By Aislinn in forum Operating Systems
    Replies: 5
    Last Post: 31-03-2010, 12:13 PM
  2. Can we use PHP from the command line?
    By kyosang in forum Software Development
    Replies: 5
    Last Post: 03-02-2010, 01:06 AM
  3. Replies: 3
    Last Post: 03-09-2009, 05:41 PM
  4. Can't Rename a File Using WinXP Command Prompt!!!
    By Kaalan in forum Windows XP Support
    Replies: 2
    Last Post: 02-05-2008, 05:14 PM
  5. Replies: 1
    Last Post: 18-05-2007, 01:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,974,938.99050 seconds with 17 queries