Batch file for copying and renaming file

March 31, 2010 at 01:40:25
Specs: Windows XP
I'm trying to build a batch file for copying and renaming files. This is what I got so far:

@echo off
echo.
echo Files:
echo.
dir c:\temp /B/OD
echo.

:FILENAME
set /p filename=Which file do you want to copy:
set /p jn=Agree? [j/n]
if "%jn%"=="" (echo Not entry) & (GOTO FILENAME)
if /I "%jn%"=="n" (GOTO FILENAME)
if /I "%jn%"=="j" (GOTO LOCATION) else (echo Entry not j or n!) & (GOTO FILENAME)

:LOCATION
copy "c:\temp" "d:\map1"


:END
echo.
set jn=
set /p jn=Copy more files? [j/n]
if "%jn%"=="" (echo Not entry) & (GOTO END)
if /I "%jn%"=="n" (GOTO QUIT)
if /I "%jn%"=="j" (GOTO FILENAME) else (echo Entry not j or n!) & (GOTO END)

:QUIT
EXIT

This works great. After the copy process the ideal situation would be that I get a question, just like :FILENAME. How I want to call the just copied file.

Any ideas?
Thanks!


See More: Batch file for copying and renaming file

Report •


#1
March 31, 2010 at 07:47:49
You need to checkout either CHOICE.COM or CHOICE.EXE which has the feature to allow a question to be asked

Report •

#2
March 31, 2010 at 11:13:27
I read that question wrong. If you need to call a file, just ... euhm, call ?


call /?


Report •

#3
April 1, 2010 at 17:00:48
maybe:

:LOCATION
set /p xx="change name to (or [ENTER] to keep same: ):
if "%xx%" neq "" set filename=%xx%
copy "c:\temp" "d:\map1\%filename%"


Report •

Related Solutions

#4
April 2, 2010 at 07:57:00
Possibly ... question is not really clear, I'm just guessing

Report •


Ask Question