Page 1 of 1

Batch file not working but not giving errors either

Posted: 16 Aug 2022 10:05
by Ad1966
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** :wink:

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

Re: Batch file not working but not giving errors either

Posted: 16 Aug 2022 16:15
by aGerman
What operating system are we talking about? I'm asking because the style of the script looks like something older than Windows NT. Also the names of some of the tools called in the script vaguely remind me on 3rd party utilities for MS DOS. I last saw something like that in the late 90's or so.

Steffen

Re: Batch file not working but not giving errors either

Posted: 17 Aug 2022 03:07
by miskox
As Steffen assumes: I too think this is MS-DOS 6.22 or earlier. More info would be required.

Saso

Re: Batch file not working but not giving errors either

Posted: 17 Aug 2022 10:18
by Ad1966
Hi, Thank you for replying.
This file runs in Windows XP. The main programme records accounting data, which is then backed up to a zip file at the end of each day. This batch file is used to retrieve older data so it can be checked against bank statements etc. so my friend can keep track of any money still owed.
I have tried extracting a zip manually but when we run the accounts prog afterwards, it gives a security error and won't show him the data. I'm guessing that's to stop people doing exactly that who aren't supposed to be looking at the data.

Re: Batch file not working but not giving errors either

Posted: 17 Aug 2022 10:50
by aGerman
List of (probably) 3rd party tools called in the script:
GETYN
PBCOPY
RESTORE
PKUNZIP
PBWAIT

Are those still installed and working as expected?

Steffen

Re: Batch file not working but not giving errors either

Posted: 29 Aug 2022 09:35
by Ad1966
They are there.

The software that was used on this pc is Perfect Books, so I guess PBCopy & PBwait are part of that.
PKUnzip is an archive programme like Winzip
Getyn seems to be Get Y or N
Restore is a DOS command

Thanks!

Re: Batch file not working but not giving errors either

Posted: 02 Sep 2022 06:09
by aGerman
I'm afraid I can't tell what's going wrong if all of those command line tools are still alive and working. That's just because I can't do any further investigation myself in front of the computer.

Maybe open a CMD prompt, navigate to the folder with the batch file using the CD command, and run the script from within the prompt. Perhaps error messages are getting visible then.

Steffen

Re: Batch file not working but not giving errors either

Posted: 02 Sep 2022 10:01
by Ad1966
I'll try that Thanks Steffen

Re: Batch file not working but not giving errors either

Posted: 28 Oct 2022 10:01
by Ad1966
I ran the DOS file from a CMD prompt and got an error! Yay! At least I now know this is what is needed. What I'll do next is change the path so the batch file is looking in the correct directory :)
I'll let you know how I get on - thanks again :)