Batch file not working but not giving errors either
Posted: 16 Aug 2022 10:05
Hi, I've been helping my friend in a support role for the last 15 years (upgrading his pcs, installing software etc.) but this problem requires a **consored**
He has zip files that contain archived data. The batch file below is supposed to recover the data from whichever zip file is placed in the relevant folder, but it doesn't work.
The data that was there previously is still there (i.e. not overwritten by the data in the zip file) and the batch file doesn't show any errors to suggest that it couldn't find new data or that it couldn't overwite the old data.
The phone number in the batch file is for a company that no longer exists. I've contacted the new owners but they only support the new product that has replaced the one my friend uses. Hence the post!
Thank you for any help,
Adam
RECOVER.BAT
- - - - - - - -
He has zip files that contain archived data. The batch file below is supposed to recover the data from whichever zip file is placed in the relevant folder, but it doesn't work.
The data that was there previously is still there (i.e. not overwritten by the data in the zip file) and the batch file doesn't show any errors to suggest that it couldn't find new data or that it couldn't overwite the old data.
The phone number in the batch file is for a company that no longer exists. I've contacted the new owners but they only support the new product that has replaced the one my friend uses. Hence the post!
Thank you for any help,
Adam
RECOVER.BAT
- - - - - - - -
Code: Select all
@ECHO OFF
REM parameters now = backupdrive + restorefilename + restorefilesize
REM IF NO PARAM, USE A
IF "%1"=="" GOTO NOPARAM
SET DRV=%1
GOTO GOTPARAM
:NOPARAM
SET DRV=A
:GOTPARAM
REM PROBLEMS WITH SECURITY - EXCLUSIVE ACCESS ON A:\ WITH WIN XP
REM SO PKZIP SPAN REMOVED - NOW USE OUR OWN FILESPLT PROGRAM
REM CHECK IF PKZIP.CFG PRESENT - WILL NOT WORK IF FOUND - DELETE IF FOUND
REM ECHO RECOVER >> ERRLOG.JC - REMOVED AS PBFORWIN NOW RECORDS THE STATUS
CLS
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º V2.0 º
ECHO º P E R F E C T B O O K S R E C O V E R P R O G R A M º
ECHO º º
ECHO º THIS WILL RESTORE (OVERWRITE) ALL OF YOUR DATA FILES º
ECHO º º
ECHO º PLEASE CONTACT THE HELPLINE BEFORE CONTINUING º
ECHO º º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
GETYN - Are You Sure You Wish To Continue
IF NOT ERRORLEVEL 1 GOTO EXIT
ECHO.
IF EXIST *.CFG DEL *.CFG
ECHO.
ECHO PLEASE LOAD THE BACKUP DISK WITH THE SECURITY COPY ON
ECHO.
GETYN - Do You Wish to Continue With The Restore
IF ERRORLEVEL 1 GOTO NEXT1
GOTO EXIT
:NEXT1
ECHO.
ECHO IF YOU WANT TO WORK ON AN OLDER SECURITY COPY -
ECHO YOU MUST SECURE THE CURRENT DATA FIRST
ECHO.
GETYN - Are You Sure You Wish To Continue
IF ERRORLEVEL 1 GOTO NEXT2
GOTO EXIT
:NEXT2
CLS
ECHO.
ECHO.
GETYN - Is The Backup Disk Ready
IF ERRORLEVEL 1 GOTO NEXT3
GOTO EXIT
:NEXT3
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º º
ECHO º P E R F E C T B O O K S R E C O V E R P R O G R A M º
ECHO º º
ECHO º PLEASE RING THE HELP LINE BEFORE CONTINUING º
ECHO º º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO ******************************************
ECHO * SECURING ON HARD DISK BEFORE RESTORE.. *
ECHO ******************************************
ECHO.
PAUSE
REM IF NOT EXIST REC\E0505.JC MD REC
PBCOPY *.* REC
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º º
ECHO º HAVE YOU CONTACTED THE HELP LINE, YET ? º
ECHO º º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
GETYN - Do You REALLY Want To Continue With The Restore
IF ERRORLEVEL 1 GOTO NEXT4
GOTO EXIT
:NEXT4
ECHO.
ECHO ********************************************
ECHO * PLEASE PUT THE BACKUP DISK IN DRIVE %DRV%: *
ECHO ********************************************
ECHO.
PAUSE
IF NOT EXIST %DRV%:\%2*.FSP GOTO NOFSP
ECHO FSP FILE FOUND
IF "%DRV%"=="A" GOTO ADRIVE
IF "%DRV%"=="a" GOTO ADRIVE
RESTORE -V REC\%2.ZIP %DRV%:\ %3 %2-
GOTO CONTINUE
:ADRIVE
RESTORE REC\%2.ZIP %DRV%:\ 1400 %2-
:CONTINUE
PKUNZIP REC\%2.ZIP
GOTO UNZIPPED
:NOFSP
IF NOT EXIST %DRV%:\PB.ZIP GOTO NOZIP
ECHO ZIP FOUND
PKUNZIP %DRV%:\PB
GOTO UNZIPPED
:NOFILES
CLS
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º º
ECHO º CANNOT FIND DATA ON BACKUP DISK. º
ECHO º CONTACT HELP AT ONCE º
ECHO º 01656 - 720071 º
ECHO º º
ECHO º TYPE CANCEL TO LEAVE THE RESTORE º
ECHO º º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
:CANCEL
ECHO.
PBWAIT CANCEL Type Cancel To Leave The Restore
GOTO EXIT
:UNZIPPED
CLS
REM PASSED THE CHECKS, SO REMOVE THE TEMP FILES
DEL *.PK
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º º
ECHO º RESTORE FINISHED, PLEASE REMOVE BACKUP DISK º
ECHO º º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
PAUSE
:EXIT