Jump to content

windows "rename" command


flying dog

Recommended Posts

Folks,

 

Sorry, but my resources are somewhat "limited".

 

I record QI episodes and when they are recorded, they are prefixed with "QI - " so I know what is what.

 

After I get time to "sort" them (or should that be collate?) the "QI- " becomes pointless.

 

I thought I could:

 

ren "QI - "*.* *.*

 

but it doesn't work. I am NOT a windoze person.

 

Sure there are programs out there to do things like that and I have them, but for things like that, it seems over the top.

 

Can a guru help me in the syntax of how to get the command to work?

 

I have tried with and without the " " around the QI part, but all to no avail.

 

Thanks in advance.

 

 

Link to comment
Share on other sites

Rename.

 

Yes Kyle I am wanting to do it from the "CMD" (or Dos) prompt.

 

I have 'n' files all prefixed with "QI - " and want to remove that in one easy "swoop".

 

Clicking on each file and manually doing it is slow and not as easy.

 

So I am wanting to do it easily/quickly.

 

fly_tornado

 

Sorry?

 

 

Link to comment
Share on other sites

Yeah, it doesn't really help with this example.

 

As I explained:

 

I thought I would enter rename (or ren) "QI -"*.* *.*

 

and nothing happens.

 

Probably a problem with the spaces.

 

There is MORE THAN ONE file I want to rename.

 

So I have (for example):

 

QI - episode1

 

QI - episode2

 

QI - episode3

 

QI - episode4

 

and so on.

 

I just want them all to be:

 

episode1

 

episode2

 

episode3

 

episode4

 

and so on.

 

 

Link to comment
Share on other sites

Hongie,

 

I have a handful of re-namer programs.

 

Thanks, but I was just wanting to make a simple rename .bat file to do it.

 

This is one example.

 

I record a lot of shows and they all have an initial prefix until they are processed. After that, the prefix doesn't need to be there.

 

Loading these programs and setting them up to "find/replace" things in each directory is painful.

 

No worries. I'll just use what I have and put up with windoze's in-ability to rename from the "CLI".

 

 

Link to comment
Share on other sites

As there are SPACES in the file name it is not that easy.

 

Found this:

 

http://superuser.com/questions/475874/how-does-the-windows-rename-command-interpret-wildcards

 

sourceMask

 

The sourceMask works as a filter to determine which files are renamed. The wildcards work here the same as with any other command that filters file names.

 

  • ? - Matches any 0 or 1 character except . This wildcard is greedy - it always consumes the next character if it is not a . However it will match nothing without failure if at name end or if the next character is a .
     
     
     
  • * - Matches any 0 or more characters including . (with one exception below). This wildcard is not greedy. It will match as little or as much as is needed to enable subsequent characters to match.
     
     

 

All non-wildcard characters must match themselves, with a few special case exceptions.

 

  • . - Matches itself or it can match the end of name (nothing) if no more characters remain. (Note - a valid Windows name cannot end with .)
     
     
     
  • {space} - Matches itself or it can match the end of name (nothing) if no more characters remain. (Note - a valid Windows name cannot end with {space})
     
     
     
  • *. at the end - Matches any 0 or more characters except . The terminating . can actually be any combination of . and {space} as long as the very last character in the mask is . This is the one and only exception where * does not simply match any set of characters.
     
     

 

 

The above rules are not that complex. But there is one more very important rule that makes the situation confusing: The sourceMask is compared against both the long name and the short 8.3 name (if it exists). This last rule can make interpretation of the results very tricky, because it is not always obvious when the mask is matching via the short name.

 

It is possible to use RegEdit to disable the generation of short 8.3 names on NTFS volumes, at which point interpretation of file mask results is much more straight forward. Any short names that were generated before disabling short names will remain.

 

Ok, so I try:

 

ren QI{space}-{space}*.* *.*

 

Doesn't work.

 

D:\WinFast WorkArea\QI>dir

 

Volume in drive D is MOVIES 0

 

Volume Serial Number is D433-F280

 

Directory of D:\WinFast WorkArea\QI

 

06-Oct-13 08:33 <DIR> .

 

06-Oct-13 08:33 <DIR> ..

 

05-Oct-13 21:19 <DIR> Converted

 

18-Sep-13 21:28 1,378,058,240 QI - Hypnosis.mpg

 

27-Sep-13 22:19 1,388,345,344 QI - Imbroglio.mpg

 

14-Sep-13 19:48 1,364,582,400 QI - International.mpg

 

06-Oct-13 08:32 1,382,608,896 QI - Invertebrates.mpg

 

4 File(s) 5,513,594,880 bytes

 

3 Dir(s) 237,635,506,176 bytes free

 

D:\WinFast WorkArea\QI>ren QI{space}-{space}*.* *.*

 

The system cannot find the file specified.

 

Ah, ya gotta love windoze.

 

 

Link to comment
Share on other sites

Are you familiar with Powershell? Its is basically an extension of DOS, and it is very powerfull, so be careful. if you are used to DOS or unix though you will be well at home

 

Download that latest version of that then use a script like this. I just wrote that, and had a different set of file extensions and repplacement terms to get rid of 'new' out of a heap of just created 'new text documents'

 

Get-ChildItem -Filter *.wmv | Rename-Item -NewName {$_.Name -replace 'QI'}

msg me if i can be of any help

 

 

Link to comment
Share on other sites

Thanks.

 

Found it, but was reading on "Whirlpool" about problems with it and nasty "extras".

 

Am holding off installing it just now.

 

I can't find a good set of instructions for it. The sites I visited said how great it is/was, but none had a full set of instructions to what it gives.

 

Dunno if that is because they are included with the install, but to me that is a bit late. I would prefer to know what it does BEFORE I install it.

 

I am having a devil of a time trying to roll back to the previous version of WMP as I accidenty installed the latest version.

 

For now I have no version installed but when I try to install the old version it says it can't/won't because I have a newer version installed.

 

This is a long term, on going problem. :(

 

 

Link to comment
Share on other sites

Can you do a system restore to an earlier point? Or go into the registry and strip out it entries?

 

Not telling you what to use, but for a media player, if wmp is frustrating you enough, try zoom player free. Has all the codecs built it, and able to be updated individual, remembers where you are up to in a file etc.

 

As for power shell commands and syntax, you can get on the msdn site and have a look, or go to powershellpro. I think that's the site, i'm out and about on mobile at present.

 

 

Link to comment
Share on other sites

(This is getting a bit off topic, but......)

 

No, when I did a rebuild - HD died horrible death - and I was installing SP3, I (stupidly) accepted WMP "latest".

 

Some software I had wanted/NEEDED WMP "latest-1".

 

So after realising this mistake I tried to uninstall it and get the earlier version.

 

Like pushing water up hill.

 

Still haven't really got it fully fixed, but...... Enough that the software works.

 

Anyway: Things are semi-ok.

 

Semi-resolved the rename problem.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...