1) Can I have a bat script in same folder as where getting data from?
2) If so is there anyway the script can be amended to merge as stated below but ignore the .bat file so I can click on it next time for when I want to merge again .
Thanks
Code: Select all
@echo off
setlocal EnableDelayedExpansion
rem Define folder paths
set BaseDir=X:\DOWNLOADS
rem Quit if no files in download area to process
set Empty=Y
for %%A in ("%BaseDir%\*.*") do set Empty=N
if "%Empty%" EQU "Y" (
echo No new files to process, quitting.
exit /b
)
rem Ask if BTP download to determine
set Download=
choice /C YN /M "Is this a BTP download (Y/N)?"
if !ERRORLEVEL! EQU 1 (
set Download=BTP
) else (
choice /C YN /M "IS THIS A CHILTERN DOWNLOAD(Y/N)?"
if !ERRORLEVEL! EQU 1 (
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
move "%BaseDir%\*.*" "%BaseDir%\%Download%%RefNum%"
Select all
Open in new window