Batch file not working but not giving errors either

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ad1966
Posts: 5
Joined: 15 Aug 2022 02:56

Batch file not working but not giving errors either

#1 Post by Ad1966 » 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** :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
Last edited by aGerman on 16 Aug 2022 15:28, edited 1 time in total.
Reason: code formatting

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file not working but not giving errors either

#2 Post by aGerman » 16 Aug 2022 16:15

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

miskox
Posts: 553
Joined: 28 Jun 2010 03:46

Re: Batch file not working but not giving errors either

#3 Post by miskox » 17 Aug 2022 03:07

As Steffen assumes: I too think this is MS-DOS 6.22 or earlier. More info would be required.

Saso

Ad1966
Posts: 5
Joined: 15 Aug 2022 02:56

Re: Batch file not working but not giving errors either

#4 Post by Ad1966 » 17 Aug 2022 10:18

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.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file not working but not giving errors either

#5 Post by aGerman » 17 Aug 2022 10:50

List of (probably) 3rd party tools called in the script:
GETYN
PBCOPY
RESTORE
PKUNZIP
PBWAIT

Are those still installed and working as expected?

Steffen

Ad1966
Posts: 5
Joined: 15 Aug 2022 02:56

Re: Batch file not working but not giving errors either

#6 Post by Ad1966 » 29 Aug 2022 09:35

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!

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file not working but not giving errors either

#7 Post by aGerman » 02 Sep 2022 06:09

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

Ad1966
Posts: 5
Joined: 15 Aug 2022 02:56

Re: Batch file not working but not giving errors either

#8 Post by Ad1966 » 02 Sep 2022 10:01

I'll try that Thanks Steffen

Ad1966
Posts: 5
Joined: 15 Aug 2022 02:56

Re: Batch file not working but not giving errors either

#9 Post by Ad1966 » 28 Oct 2022 10:01

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 :)

Post Reply