REN command in CMD for folders

G

Guest

I am trying to use the REN command in the command prompt to rename a batch of
FOLDERS in one directory. The names are all 11 digits, long mostly letters,
with a number as the last character. At the moment they all have a 5 at the
end of the name, but I want to be able to change this last character to any
other number in one go.
I can do this for a group of txt FILES named 1115,2225,3335,4445..etc by
entering..
Ren U:\folder1\folder2\???5.txt ???6.txt
Which will change the file names to 1116,2226,3336,4446...etc

I want to be able to do the same for the folders however if i try and use
the wildcard characters when changing the name of folders I get an error
message saying "The syntax of the command is incorrect"

This is an example of what i'm trying
Ren U:\Folder1\???5 ???6

Does anyone know why this multiple folder rename won't work like the file
rename does and if it's possible to do what I want using RENAME command.
Any help greatly appreciated, though please dont point me to any third party
software, I am at work and so cannot download any such software which i
realise would be the easy option.
 
M

Merlin

Magg said:
I am trying to use the REN command in the command prompt to rename a batch
of
FOLDERS in one directory. The names are all 11 digits, long mostly
letters,
with a number as the last character. At the moment they all have a 5 at
the
end of the name, but I want to be able to change this last character to
any
other number in one go.
I can do this for a group of txt FILES named 1115,2225,3335,4445..etc by
entering..
Ren U:\folder1\folder2\???5.txt ???6.txt
Which will change the file names to 1116,2226,3336,4446...etc

I want to be able to do the same for the folders however if i try and use
the wildcard characters when changing the name of folders I get an error
message saying "The syntax of the command is incorrect"

This is an example of what i'm trying
Ren U:\Folder1\???5 ???6

Does anyone know why this multiple folder rename won't work like the file
rename does and if it's possible to do what I want using RENAME command.
Any help greatly appreciated, though please dont point me to any third
party
software, I am at work and so cannot download any such software which i
realise would be the easy option.


the Ren or RENAME command is for renaming files not folders.
 
G

Guest

Merlin said:
the Ren or RENAME command is for renaming files not folders.


Yes I realise that, but it is possible to use it to rename folders,
e.g. Ren U:\folder1\1111 2222
Will change the folder name 1111 to 2222
You just dont seem to be able to use specail characters such as ? in the
syntax and I was asking if anyone knows if there's a way around it.
 
M

Merlin

Magg said:
e.g. Ren U:\folder1\1111 2222
Will change the folder name 1111 to 2222
You just dont seem to be able to use specail characters such as ? in the
syntax and I was asking if anyone knows if there's a way around it.


Have you tried using Ren U\Folder1\*5 *6 ?
 
G

Guest

Have you tried using Ren U\Folder1\*5 *6 ?
Ooops I just clicked on the yes for "did this answer your question" sorry,
it was helpful but it doesn't seem to work. Neither does any combination of
asteriks and question marks that might logically work. Thanks for the help
looks like i'll just have to change them manually
 
P

Pegasus \(MVP\)

Magg said:
I am trying to use the REN command in the command prompt to rename a batch
of
FOLDERS in one directory. The names are all 11 digits, long mostly
letters,
with a number as the last character. At the moment they all have a 5 at
the
end of the name, but I want to be able to change this last character to
any
other number in one go.
I can do this for a group of txt FILES named 1115,2225,3335,4445..etc by
entering..
Ren U:\folder1\folder2\???5.txt ???6.txt
Which will change the file names to 1116,2226,3336,4446...etc

I want to be able to do the same for the folders however if i try and use
the wildcard characters when changing the name of folders I get an error
message saying "The syntax of the command is incorrect"

This is an example of what i'm trying
Ren U:\Folder1\???5 ???6

Does anyone know why this multiple folder rename won't work like the file
rename does and if it's possible to do what I want using RENAME command.
Any help greatly appreciated, though please dont point me to any third
party
software, I am at work and so cannot download any such software which i
realise would be the easy option.

You can do this sort of thing with a batch file. Post again if
you're still interested.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top