Page 1 of 1

Batch file to rename a folder and prompt the user

Posted: 10 Nov 2008 07:09
by kumar_thabe
Hi, I am trying to create a batch file to do the followings tasks.

Iv'e got a project folder and that has all the settings. When I create a new project folder then I copy the folder "New Projects" and rename it. But that has to be done by script or the batch file. And the issue is, the batch file or the script file should prompt the user to enter the new folder name. The old folder name is always same, But the new folder name is always different.

I am trying to create a batch file but it's failled. Enyone can help me?

Thanks a lot!

Posted: 22 Nov 2008 23:59
by DosItHelp
kumar_thabe,

How about this:

Code: Select all

@echo off
set "prjFolder=c:\YourProjectFolder\"
set "srcFolder=New Projects"
set /p "trgfolder=Enter Name for Target Folder: "
xcopy /discy "%prjFolder%%srcFolder%" "%prjFolder%\%trgfolder%"
pause

DosItHelp? :wink: