I am looking for assistance with why this script fails to execute. I was under the impression that scripting in BA was basically batch file scripting, however this script keeps erroring with the message "GOTO was unexpected at this time." error code 252
Here is the script :
- Code: Select all
@echo off
for /f "delims=\" %%a in (%BACKUP_FILENAME%) do set DRIVELETTER=%%a
if %DRIVELETTER% == "c:" GOTO END
if %DRIVELETTER% == "C:" GOTO END
if %DRIVELETTER% == "d:" GOTO END
if %DRIVELETTER% == "D:" GOTO END
if %DRIVELETTER% == "" GOTO END
pushd %DRIVELETTER%
IF EXIST .catalogues (GOTO FOUND)
GOTO END
:FOUND
for /f "tokens=1-5*" %%1 in ('vol') do (
set VOLUME=%%6 & GOTO FORMAT
)
:FORMAT
echo y | format %DRIVELETTER% /fs:ntfs /v:%VOLUME% /q/x
GOTO END
:END
The idea of the script is to format the external HDD before starting the backup, it works flawlessly as a batch file, but gives the above error when using it inside Backup Assist. Can anyone tell me why this error is occuring?