Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

rename bug from CMD

microsoft.public.windows.vista.file management






Speedup My PC
Reply
  #1 (permalink)  
Old 03-28-2007
=?Utf-8?B?UHVjYXJh?=
 

Posts: n/a
rename bug from CMD
Hi,

Someone has noticed that the rename command (from cmd.exe) has changed
its behavior? before I used to rename files like this:

rename new*.txt test*.txt

and it will rename the files like this:

newname.txt to testname.txt

Now it seems to "ovewrite" the name to something like this:

from newname.txt to testame.txt

Note that the "n" has been overwritten. Someone know some workarround to
this? The help does not give much info...

I have hundreds of CMD and BAT files that I need to change...

Thanks,

Mariano.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-28-2007
OKuma
 

Posts: n/a
Re: rename bug from CMD
It does the same thing in XP.

The problem is that the original file name is 7 characters long, and the new
filename is 8 characters long.

Rename will truncate the beginning of the wildcard characters until it meets
the same amount of characters in the original filename.

If you did rename new*.txt tst*.txt, you would get the proper results of
your file being renamed to tstname.txt

OKuma

"Pucara" <Pucara@discussions.microsoft.com> wrote in message
news:94AA3EA6-5167-4F76-AB8F-6748226C652B@microsoft.com...
> Hi,
>
> Someone has noticed that the rename command (from cmd.exe) has changed
> its behavior? before I used to rename files like this:
>
> rename new*.txt test*.txt
>
> and it will rename the files like this:
>
> newname.txt to testname.txt
>
> Now it seems to "ovewrite" the name to something like this:
>
> from newname.txt to testame.txt
>
> Note that the "n" has been overwritten. Someone know some workarround to
> this? The help does not give much info...
>
> I have hundreds of CMD and BAT files that I need to change...
>
> Thanks,
>
> Mariano.


Reply With Quote
  #3 (permalink)  
Old 03-29-2007
=?Utf-8?B?UHVjYXJh?=
 

Posts: n/a
Re: rename bug from CMD
Hi Okuma,

Well, teh ren command has changed, with some service pack (I have tested
with SP1 and does this bad renaming thing), but I can assure you in prior
versions the behavior was different. I'm trying to determine when that has
changed... in Windows 2003 Server, does the same bad thing. I'm pasting you a
KB article that describes the correct functionallity I have used in the past:

http://support.microsoft.com/default.aspx/kb/320167

You must read the notes at the bottom, quoted from there:

"The Rename function in Windows Explorer does not match the behavior of the
REN command you may use at a command prompt. 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."

So, maybe their is some registry value I can change to get the old behavior
back.

Thanks for your reply.

Mariano.

"OKuma" wrote:

> It does the same thing in XP.
>
> The problem is that the original file name is 7 characters long, and the new
> filename is 8 characters long.
>
> Rename will truncate the beginning of the wildcard characters until it meets
> the same amount of characters in the original filename.
>
> If you did rename new*.txt tst*.txt, you would get the proper results of
> your file being renamed to tstname.txt
>
> OKuma
>
> "Pucara" <Pucara@discussions.microsoft.com> wrote in message
> news:94AA3EA6-5167-4F76-AB8F-6748226C652B@microsoft.com...
> > Hi,
> >
> > Someone has noticed that the rename command (from cmd.exe) has changed
> > its behavior? before I used to rename files like this:
> >
> > rename new*.txt test*.txt
> >
> > and it will rename the files like this:
> >
> > newname.txt to testname.txt
> >
> > Now it seems to "ovewrite" the name to something like this:
> >
> > from newname.txt to testame.txt
> >
> > Note that the "n" has been overwritten. Someone know some workarround to
> > this? The help does not give much info...
> >
> > I have hundreds of CMD and BAT files that I need to change...
> >
> > Thanks,
> >
> > Mariano.

>

Reply With Quote
  #4 (permalink)  
Old 03-29-2007
cquirke (MVP Windows shell/user)
 

Posts: n/a
Re: rename bug from CMD
On Thu, 29 Mar 2007 05:20:04 -0700, Pucara

>"The Rename function in Windows Explorer does not match the behavior of the
>REN command you may use at a command prompt. 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 you do a lot of bulk logic-based renaming, you may want to try the
free CK Rename utility. I don't know if it can be automated (and thus
replace Cmd-based renaming) but it's great for cleaning up
freshly-ripped .MP3 names etc. and you can see a preview of its
effects before "pulling the trigger" to commit these changes.

See http://www.musicsucks.com/CKSoft/index.htm



>--------------- ----- ---- --- -- - - -

IRC is just multiplayer notepad.
>--------------- ----- ---- --- -- - - -

Reply With Quote
  #5 (permalink)  
Old 03-29-2007
 

Posts: n/a
Re: rename bug from CMD
And when REN wildcards don't do what you want, the traditional way is to use
for loops - then one has substrings, etc.

Here is a thread where I explain how to use For for batch renaming.

http://groups.google.com.au/group/mi...aa1d13a09fae18

"cquirke (MVP Windows shell/user)" <cquirkenews@nospam.mvps.org> wrote in
message news:5s5o031ut96q1p9e3vcntmdomdfkvc24c8@4ax.com...
> On Thu, 29 Mar 2007 05:20:04 -0700, Pucara
>
>>"The Rename function in Windows Explorer does not match the behavior of
>>the
>>REN command you may use at a command prompt. 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 you do a lot of bulk logic-based renaming, you may want to try the
> free CK Rename utility. I don't know if it can be automated (and thus
> replace Cmd-based renaming) but it's great for cleaning up
> freshly-ripped .MP3 names etc. and you can see a preview of its
> effects before "pulling the trigger" to commit these changes.
>
> See http://www.musicsucks.com/CKSoft/index.htm
>
>
>
>>--------------- ----- ---- --- -- - - -

> IRC is just multiplayer notepad.
>>--------------- ----- ---- --- -- - - -


Reply With Quote
  #6 (permalink)  
Old 03-30-2007
=?Utf-8?B?UHVjYXJh?=
 

Posts: n/a
Re: rename bug from CMD
Thanks to all for the workarrounds... I was using one too, a vbs script. I
like the batch one. Anyway I wonder why someone has to change that behavior,
don't make too much sense to me.

Thanks to all for the replies.

Mariano.

"." wrote:

> And when REN wildcards don't do what you want, the traditional way is to use
> for loops - then one has substrings, etc.
>
> Here is a thread where I explain how to use For for batch renaming.
>
> http://groups.google.com.au/group/mi...aa1d13a09fae18
>
> "cquirke (MVP Windows shell/user)" <cquirkenews@nospam.mvps.org> wrote in
> message news:5s5o031ut96q1p9e3vcntmdomdfkvc24c8@4ax.com...
> > On Thu, 29 Mar 2007 05:20:04 -0700, Pucara
> >
> >>"The Rename function in Windows Explorer does not match the behavior of
> >>the
> >>REN command you may use at a command prompt. 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 you do a lot of bulk logic-based renaming, you may want to try the
> > free CK Rename utility. I don't know if it can be automated (and thus
> > replace Cmd-based renaming) but it's great for cleaning up
> > freshly-ripped .MP3 names etc. and you can see a preview of its
> > effects before "pulling the trigger" to commit these changes.
> >
> > See http://www.musicsucks.com/CKSoft/index.htm
> >
> >
> >
> >>--------------- ----- ---- --- -- - - -

> > IRC is just multiplayer notepad.
> >>--------------- ----- ---- --- -- - - -

>
>

Reply With Quote
  #7 (permalink)  
Old 03-30-2007
cquirke (MVP Windows shell/user)
 

Posts: n/a
Re: rename bug from CMD
On Fri, 30 Mar 2007 07:56:26 +1000, <.> wrote:

>And when REN wildcards don't do what you want, the traditional way is to use
>for loops - then one has substrings, etc.


Argh, the dreaded For syntax... <twitch><gibber>
<is quitely leat away by attendant>

I've used For, but I always have to look up the syntax - I can never
remember it. It's pretty slippery and caveat-prone, so a fair bit of
testing is recommended before use on "real" things ;-)

>Here is a thread where I explain how to use For for batch renaming.


>http://groups.google.com.au/group/mi...aa1d13a09fae18


Thanks. What often ambushes one with these things (in the Cmd.exe age
of expanded batch file syntax) is that using parentheses to block a
number of statements as a single "statment" may not be supported.



>-------------------- ----- ---- --- -- - - - -

Tip Of The Day:
To disable the 'Tip of the Day' feature...
>-------------------- ----- ---- --- -- - - - -

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BUG: in Instant Search when you rename a file with [1] in its name =?Utf-8?B?QmlsbEQ=?= microsoft.public.windows.vista.general 5 03-17-2007 14:11
BUG: found a bug in Event Viewer - can't rename a personalized vie =?Utf-8?B?QmlsbEQ=?= microsoft.public.windows.vista.general 1 03-15-2007 16:31
CMD in all versions of vista? =?Utf-8?B?a3Jhenlkb2c=?= microsoft.public.windows.vista.networking sharing 2 03-14-2007 16:39
CMD Dave Boomhauer microsoft.public.windows.vista.general 3 03-01-2007 13:59
Cannot delete or rename folder =?Utf-8?B?bm9ydGhlbmQ=?= microsoft.public.windows.vista.file management 3 02-28-2007 14:15




All times are GMT +1. The time now is 18:39.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120