A portion of a script I am writing prompts the user to select all directories that are required for their specific process Most times, the user will need to select multiple directories, not just one.
Then, later on the script, those directories the user selected will need to be copied to a another location. What is the best way to do this? I can do it easily if it was only one directory. As shown here:
Code: Select all
echo ***************************************************
echo RETRIEVING CONTENTS OF LCM import_export DIRECTORY
echo ---------------------------------------------------
echo -- This may take 1 minute --
echo ---------------------------------------------------
for /d /r "C:\" %%a in (*) do if /i "%%~nxa"=="import_export" set "IMP_EXP_DIR=%%a"
DIR %IMP_EXP_DIR%
echo.
PAUSE
:REDO_MIG_DEF
echo ********************************************************
echo WHAT IS THE NAME OF YOUR MIGRATION DEFINITION DIRECTORY?
echo --------------------------------------------------------
echo.
set /p MIG_DEF_DIR=
echo.
echo.
echo IS "%MIG_DEF_DIR%" CORRECT?
echo.
echo.
echo [1] Yes
echo.
echo [2] No
echo.
set /p MIG_DEF_Q=
IF %MIG_DEF_Q%==1 GOTO APP_NAME
IF %MIG_DEF_Q%==2 GOTO REDO_MIG_DEF
Then later on, the directory is copied:
Code: Select all
echo ************************************************************
echo CREATING NEW MIGRATION DEFINITION FOR %NEW_APP_NAME1% IMPORT
echo ------------------------------------------------------------
echo.
TIMEOUT /T 3 >nul
ECHO d | XCOPY /d /e /y %LCM_IE_PATH%\%MIG_DEF_DIR% %LCM_IE_PATH%\%NEW_APP_MIG_DEF% 2 >nul
In conclusion, how do I capture more than 1 selection and then use those selections in a copy command?
Thanks!