Help in moving files within a script.

August 8, 2018 at 11:23:16
Specs: Windows 7
Hi I have the following script but im trying to arrange to move the completed folder once merged and named from C:\downloads into C :/downloads1 and if it a BTP download also I need it to open the folder C:\downloads1 and then a message box or something to appear stating to add btp statement and 7zip file.

Can anyone help on the best way I can do that.

Script below

echo off
setlocal EnableDelayedExpansion

rem Define folder paths
set BaseDir=c:\DOWNLOADS

rem Quit if no files in download area to process
rem (excluding the batch file)
dir /b "%BaseDir%\*" 2>nul | find /v "%~nx1" >nul || (
    echo No new files to process, quitting.
    exit /b
)

rem Ask which download type 
set Download=
choice /c BC /M "(B)TP or (C)hiltern download?"
 
if errorlevel 1 set Download=BTP
if errorlevel 2 set Download=CHILTERN
 

rem Prompt for reference number
set RefNum=
set /P "RefNum=Enter reference number (blank to exit):"

rem If none entered, exit script
if "%RefNum%" EQU "" exit /b

rem Make a subfolder for the reference number
md "%BaseDir%\%Download%%RefNum%"

rem Move all files to new subfolder
attrib +h %~F1
move "%BaseDir%\*.*" "%BaseDir%\%Download%%RefNum%"
attrib -h %~F1

Thanks


See More: Help in moving files within a script.

Reply ↓  Report •
Related Solutions


Ask Question