DOS rename function

April 2, 2010 at 11:25:00
Specs: Windows XP
How to rename a file such as WQ12345 to WQA12345 without loosing numbers.
I used ren WQ***** WQA***** and I loose the first number in the rename.
Thanks
KU

See More: DOS rename function

Report •


#1
April 2, 2010 at 11:44:12
If you're using DOS, you have to hold to the 8.3 naming convention or your filenames will be truncated.

In other words, it has to be:

12345678.abc

if you try to use 123456789.abc, it will be shortened to something like 123456~1.abc


Report •

#2
April 2, 2010 at 11:49:23
ok thanks, so I guess that cannot be done.

Report •

#3
April 2, 2010 at 12:28:33
I could be done in DOS but are you using XP?


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
April 2, 2010 at 12:55:00
Yes XP

Report •

#5
April 2, 2010 at 13:12:26
First thing is to define the requirement.

Do you want to add a character after the second characterand move the rest to the right?

Or what?


=====================================
Helping others achieve escape felicity

M2


Report •

#6
April 2, 2010 at 13:31:02
Exactly!

I want to be able to change the first two letters such as WQ to either 1, 2, or 3 letters without truncating the number at the end.

This is for water quality graphs, so the data file saves as WQ12345 (the number is a well number so it is very important). I want to replace the WQ with the Parameter abbreviation such as, CA, K, CHL, etc. (i.e., CHL12345)

Thanks


Report •

#7
April 2, 2010 at 14:03:08
This doesn't DO any rename but previews what's to be done.

==================================
@echo off & setLocal EnableDELAYedeXpansion

set /p A=Parameter abbreviation ? :

set old=QA12345
set base=!old:~2!
echo ren !old! !A!!base!


=====================================
Helping others achieve escape felicity

M2


Report •

#8
April 2, 2010 at 15:17:54
Thanks for your help, but I found an easy way to rename files with a free download software. It does exactly what I need to do.

Thanks,
KU


Report •


Ask Question