Batch file to prompt user for a choice of operations
Posted: 12 Feb 2011 18:32
My OS is XP-PRO SP3
How can I have this batch file prompt the user to select one of the choices below?
1. Terminate program at this point.
2. Perform this operation.
3. Skip this operation and go to the next operation.
Thank you.
How can I have this batch file prompt the user to select one of the choices below?
1. Terminate program at this point.
2. Perform this operation.
3. Skip this operation and go to the next operation.
Thank you.
Code: Select all
@ECHO OFF
echo "Enter FolderName"
set /p FolderName=
xxcopy "D:\Program Files\%FolderName%\" /RMDIR /YY
xxcopy "C:\Program Files\%FolderName%\" "D:\Program Files\%FolderName%\" /KS /H /E /YY /R
echo REPLACED %FolderName% IN Program Files ON DRIVE D
SLEEP 2000
xxcopy "F:\Program Files\%FolderName%\" /RMDIR /YY
xxcopy "C:\Program Files\%FolderName%\" "F:\Program Files\%FolderName%\" /KS /H /E /YY /R
echo REPLACED %FolderName% IN Program Files ON DRIVE F
echo %FolderName% REPLACEMENT IN Program Files ON LOCAL COMPUTER COMPLETE.
::-----------------------------------------------------------------------
:: NEED A PROMPT HERE TO SELECT ONE OF THE FOLLOWING
:: 1. TERMINATE PROGRAM
:: 2. REPLACE %FolderName% IN Program Files ON DRIVE H
:: 3. SKIP DRIVE H AND GO TO REPLACE %FolderName% IN Program Files ON DRIVE H
::-----------------------------------------------------------------------
echo TO TERMINATE CLOSE THIS WINDOW.
echo TO CONTINUE REPLACEMENT OF %FolderName% ON REMOTE DRIVE H
PAUSE
xxcopy "H:\Program Files\%FolderName%\" /RMDIR /YY
xxcopy "C:\Program Files\%FolderName%\" "H:\Program Files\%FolderName%\" /KS /H /E /YY /R
echo REPLACED %FolderName% IN Program Files ON DRIVE H
PAUSE