take input and append to file name

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
bt
Posts: 1
Joined: 14 Sep 2009 12:26

take input and append to file name

#1 Post by bt » 14 Sep 2009 12:31

If I want to ask the user for input and append it to the file name, how do I do that given:

Code: Select all

set INPUT
set /P INPUT=Revision of file:

copy file

Where file is test.txt and I want revision 1 so the final file name is testREV1.txt.

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 15 Sep 2009 10:22

Code: Select all

set /p INPUT=Revision of file:
move test.txt testREV%INPUT%.txt

Post Reply