Batch File To Rename Files

44 views
Skip to first unread message

Henry

unread,
Dec 1, 2005, 7:10:41 PM12/1/05
to
I want to create a dos batch file in XP that will ask the user to input a
number of up to 4 characters then use that input to rename and copy files.

e.g. in UNIX I would have something simple like;

echo "Please enter number"
read $x
mv c:\elephant c:\eleph$xant

--
~~~~~~~~~~
All the best,

Henry
~~~~~~~~~~


foxidrive

unread,
Dec 2, 2005, 12:09:01 AM12/2/05
to
On Fri, 2 Dec 2005 00:10:41 -0000, Henry wrote:

> I want to create a dos batch file in XP that will ask the user to input a
> number of up to 4 characters then use that input to rename and copy files.
>
> e.g. in UNIX I would have something simple like;
>
> echo "Please enter number"
> read $x
> mv c:\elephant c:\eleph$xant

set /p "var=Enter a four digit number "
ren "file.txt" "file%var%.txt"

Henry

unread,
Dec 2, 2005, 11:58:40 AM12/2/05
to

"foxidrive" <woo...@gotcha.invalid> wrote in message
news:o532xz48p8wp$.18zk8ly5fc5j6.dlg@40tude.net...

Thanks foxidrive that is perfect!

I did a bit of DOS stuff a few years ago but have been using UNIX recently
and couldn't quite get my head around this.

I have been experimenting using it to make new folders as well.

This is going to save creating a folder and copying and renaming 5 template
files each time several times a day at work!!

Reply all
Reply to author
Forward
0 new messages