REM REM Cleanup left over files -- both before and after test run REM setlocal ENABLEDELAYEDEXPANSION CALL scripts\cleanup IF NOT "@autochanger@" == "nul" ( SET slot=0 FOR /f %%i in ( 'bin\mtx-changer @autochanger@ loaded 0 dummy 0' ) DO SET slot=%%i IF !slot! NEQ 2 ( bin\mtx-changer @autochanger@ unload 0 @tape_drive@ 0 bin\mtx-changer @autochanger@ load 2 @tape_drive@ 0 ) mt -f @tape_drive@ rewind mt -f @tape_drive@ weof REM REM If we have an autochanger always load tape in slot 1 REM FOR /f %%i in ( 'bin\mtx-changer @autochanger@ loaded 0 dummy 0' ) DO SET slot=%%i IF !slot! NEQ 1 ( bin\mtx-changer @autochanger@ unload 0 @tape_drive@ 0 bin\mtx-changer @autochanger@ load 1 @tape_drive@ 0 ) ) mt -f @tape_drive@ rewind mt -f @tape_drive@ weof