;Recovery script SAMPLE -- DO NOT RUN WITHOUT modifications
;
;Update the DFSee commands to match the situation, remove 'rem' where needed
;remove the following two lines when modifications are done
confirm DO NOT RUN this script!  It is just a demo SAMPLE!~~Use <Esc> until script has stopped!
disk 99
;
;Recovery script sample, remove unneeded sections; uncomment and edit the rest
; ~ no-parameters when run with script-file-dialog prompting~
;
; Recreate one partition taking all freespace, and fix the bootsector
;
;;defaultparam 1 NTFS                   ;partition type
;;defaultparam 2 3                      ;disk to work on
;;defaultparam 3 4                      ;number of disks
;;defaultparam 4 log                    ;primary or logical
;;defaultparam 5 4                      ;relative partition number
;
log $0 ;same as scriptname
about -P-
;
;;error ignore
;
if ($_disks == $3)
  fdisk disk $2
  if ($_rc == 0)
    confirm -y Create/recover $4 $1 partition on disk $2
    if $_rc == 0
      ;;error quit
      batch on
      cr $4 $1 -d:$2
      if $_rc == 0
        part $5,r
        ;;error ignore
        fs $1
        fixboot
        if $_rc == 0
          part
          confirm Create $4 $1 partition on disk $2 completed, and $1 fixboot done~~Press a key to exit the DFSee program ...
        else
          confirm Fixboot on $1 partition failed, spare bootsector not found
        endif
      else
        confirm Create partition failed, probably due to a wrong disk as number $2
      endif
    else
      confirm Recovery canceled by user
    endif
  else
    confirm Unable to select disk $2 for recovery
  endif
else
  if ($_disks > $3)
    confirm There should be only be $3 disks, $_disks are present now.~Remove any extra disks ...
  else
    confirm There should be $3 disks, only $_disks detected now
  endif
endif
;
batch off
log             ;close logfile
;
q
