OK, I'm so utterly lost now it's not even funny.
I goofed and have the batch running from the external it was to be detecting.
If it's not connected, the batch can't run so it's pointless.
I've been trying to rewrite the batch now for the better part of 7 hours...
I'll now store the batch in the C:\ folder.
My backup will get dumped into the same folder.
AFTER the batch detects my external, whatever drive letter that may be, I now need it to check if a folder exists in that drive.
If the folder exists, delete the old backup contained therein.
If the folder doesn't exist, it needs to create the folder and then move the backup image it.
I've tried all sorts of variations of syntax for the commands CHDIR, MKDIR, IF NOT EXIST, etc, all containing the %%N variable, but I just can't get this nailed down.
Umm, so here's what I'm now working with:
@ECHO OFF & SETLOCAL ENABLEDELAYEDEXPANSION
:: ***RUN BACKUP***
:BACKUP
CLS
ECHO Starting Backup...
ECHO.
TIMEOUT 3 /NOBREAK >NUL
0>NUL SET /P=Awaiting Acronis image dump...
"C:\Program Files (x86)\Common Files\Acronis\TrueImageHome\TrueImageHomeService.exe" /script: "C:\ProgramData\Acronis\TrueImageHome\Scripts\38FAF255-2450-41CD-9795-B1BFA5EBCF0E.tib.tis"
IF NOT EXIST MyBackup.tib CALL :FAIL
CALL :EXTERNAL
:FAIL
ECHO Fail^^!
TIMEOUT 1 /NOBREAK >NUL
ECHO.
ECHO Press any key to try again...
PAUSE >NUL
CALL :BACKUP
:: ***FIND EXTERNAL***
:EXTERNAL
ECHO Done^^!
TIMEOUT 3 /NOBREAK >NUL
SET SN=30BC-F5A4
SET found=
0>NUL SET /P=Searching for external drive...
TIMEOUT 3 /NOBREAK >NUL
FOR %%N IN (D E F G H I J K L M O P Q R S T U V W X Y Z) DO (
IF defined found CALL :MOVE
VOL %%N: 2>NUL | FIND "%sn%" >NUL && CALL :MOVE %%N
)
ECHO Fail^^!
TIMEOUT 1 /NOBREAK >NUL
ECHO.
ECHO Connect it now and cancel "Autoplay".
TIMEOUT 1 /NOBREAK >NUL
ECHO.
ECHO Press any key to try again...
PAUSE >NUL
CALL: EXTERNAL
:: ***MOVE BACKUP***
:MOVE
SET "found=yes"
ECHO Found^^!
TIMEOUT 3 /NOBREAK >NUL
0>NUL SET /P=Moving backup to external drive...
IF NOT EXIST "%%N:\Acronis Backups\" MKDIR "%%N:\Acronis Backups\"
CHDIR /D "%%N:\Acronis Backups\"
IF EXIST MyBackup.tib DEL MyBackup.tib
CHDIR /D "%~dp0"
MOVE /Y MyBackup.tib "%%N:\Acronis Backups\"
0>NUL SET /P=Move complete^^!
TIMEOUT 3 /NOBREAK >NUL
ECHO Until next time^^! ;)
TIMEOUT 3 /NOBREAK >NUL
PAUSE >NUL
EXIT
As always, thanks for the helping hand!