home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 1999 December / PCWELT_CD.ISO / software / hw / platte / DR_95.exe / Dr95.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-12-10  |  18.7 KB  |  675 lines

  1. Program Dr95; {Entire source code for Drastical Restorer, VER 1.00}
  2.  
  3. Uses Crt,Dos;
  4.  
  5. var CurrentDirList: Array[0..14] of String;
  6.     DirAlreadyDoneList:Array[1..14] of String;
  7.     OutF :Text;
  8.  
  9. Function SameString(SourceString,TargetString:String):Boolean;
  10. var I: Byte;
  11.     SameFlag: Boolean;
  12. begin
  13.      If Length(TargetString)<>Length(SourceString) Then
  14.      begin
  15.           SameString:=False;
  16.           Exit;
  17.      end;
  18.  
  19.      SameFlag:=True;
  20.      For I:=1 To Length(TargetString) Do
  21.          If SourceString[I]<>TargetString[I] Then SameFlag:=False;
  22.     SameString:=SameFlag;
  23. end;
  24.  
  25. Function IncludedString(SourceString,TargetString:String):Boolean;
  26. var I:Byte;
  27.     SameFlag:Boolean;
  28. begin
  29.      If Length(TargetString)>Length(SourceString) Then
  30.      begin
  31.           IncludedString:=False;
  32.           Exit;
  33.      end;
  34.  
  35.      SameFlag:=True;
  36.      For I:=1 To Length(TargetString) Do
  37.          If SourceString[I]<>TargetString[I] Then SameFlag:=False;
  38.      IncludedString:=SameFlag;
  39. end;
  40.  
  41. Function WinDir:String;
  42. var AFile: Text;
  43.     Current, DummyStr: String;
  44.     I: Byte;
  45. begin
  46.      Assign(AFile,'C:\MSDOS.SYS');
  47.      {$I-} Reset(AFile); {$I+}
  48.      If IOResult <> 0 Then
  49.      begin
  50.           WinDir:='';
  51.           Exit;
  52.      end;
  53.  
  54.      Repeat
  55.            ReadLn(Afile,Current); {WriteLn(Current);}
  56.            If IncludedString(Current,'WinDir=') Then
  57.            begin
  58.                 Close(Afile);
  59.  
  60.                 DummyStr:='';
  61.                 For I:=8 To Length(Current) Do DummyStr:=DummyStr+Current[I];
  62.                 WinDir:=DummyStr+'\';
  63.                 Exit;
  64.            end;
  65.      Until EOF(AFile);
  66.  
  67.      Close(AFile);
  68.      WinDir:='';
  69. end;
  70.  
  71. Procedure DelFile(FileName:String);
  72. var AFile:File;
  73. begin
  74.      Assign(AFile, FileName);
  75.      {$I-}
  76.           SetFAttr(AFile,$20); {Archive}
  77.           Erase(AFile);
  78.      {$I+}
  79. end;
  80.  
  81.  
  82. Procedure Init;
  83. var I:Byte;
  84. begin
  85.      If Windir='' Then
  86.      begin
  87.           WriteLn;
  88.           WriteLn('Unable to find Windows 95''s directory.');
  89.           WriteLn;
  90.           Halt(0);
  91.      end;
  92.  
  93.      CurrentDirList[0]:=WinDir;
  94.      For I:=1 To 14 Do
  95.      begin
  96.           CurrentDirList[I]:='';
  97.           DirAlreadyDoneList[I]:='';
  98.      end;
  99. end;
  100.  
  101. Function LastTreeLevel:Byte;
  102. var I:Byte;
  103. begin
  104.      I:=0;
  105.      While (CurrentDirList[I]<>'') and (I<=14) Do
  106.      begin
  107.           Inc(I)
  108.      end;
  109.      LastTreeLevel:=I;
  110. end;
  111.  
  112. Function CurrentDirName:String;
  113. var Dummy:String;
  114.     I:Byte;
  115. begin
  116.      Dummy:=''; I:=0;
  117.  
  118.      While (CurrentDirList[I]<>'') and (I<=14) Do  {   <== Pas d'overflow  }
  119.      begin                                         {       checking!       }
  120.            Dummy:=Dummy+CurrentDirList[I];
  121.            Inc(I);
  122.      end;
  123.      CurrentDirName:=Dummy;
  124. end;
  125.  
  126. Function IsDir(DirInfo:SearchRec):Boolean;
  127. begin
  128.      If (DirInfo.Attr and ($10))=$10 then
  129.      begin
  130.           If ((DirInfo.Name<>'.') and (DirInfo.Name<>'..')) Then
  131.           begin
  132.                IsDir:=True;
  133.                Exit;
  134.           end;
  135.      end;
  136.      IsDir:=False;
  137. end;
  138.  
  139. Function GiveNextDir:String;
  140. var DirInfo:SearchRec;
  141.     DoneFlag:Boolean;
  142. begin
  143.      If DirAlreadyDoneList[LastTreeLevel]='' Then DoneFlag:=True else DoneFlag:=False;
  144.  
  145.      FindFirst(CurrentDirName+'*.*',$FF,DirInfo);
  146.      While DosError=0 Do
  147.      begin
  148.            If IsDir(DirInfo) Then
  149.            begin
  150.                  {*} {WriteLn('     '+DirInfo.Name+ ' ',  DoneFlag,' ',DirAlreadyDoneList[LastTreeLevel]); ReadLn;}
  151.                 If DoneFlag=True Then
  152.                 begin
  153.                      GiveNextDir:=DirInfo.Name+'\';
  154.                      Exit;
  155.                 end;
  156.                 If (DirInfo.Name+'\')=DirAlreadyDoneList[LastTreeLevel] Then DoneFlag:=True;
  157.            end;
  158.            FindNext(DirInfo);
  159.      end;
  160.      GiveNextDir:='';
  161. end;
  162.  
  163. Procedure ListFile(DirName:String);
  164. var DirInfo: SearchRec;
  165.  
  166. begin
  167.      FindFirst(DirName+'*.*',$FF,DirInfo);
  168.      While DosError=0 Do
  169.      begin
  170.           If (DirInfo.Attr and $10)=0 Then WriteLn(OutF,DirName+DirInfo.Name);
  171.           FindNext(DirInfo);
  172.      end;
  173. end;
  174.  
  175. Procedure ListDir(DestinationDir:String);
  176. var DummyDir:String;
  177.     LastLevel:Byte;
  178.     I:Byte;
  179. begin
  180.      Init;
  181.      WriteLn;
  182.      WriteLn('Listing all files in '+WinDir);
  183.      Assign(OutF,DestinationDir+'LIST.TXT');
  184.      ReWrite(OutF);
  185.  
  186.      Repeat
  187.            DummyDir:=GiveNextDir;
  188.            If DummyDir<>'' Then CurrentDirList[LastTreeLevel]:=DummyDir;
  189.            If DummyDir='' Then
  190.            begin
  191.                 {  Place here the current directory's
  192.                    files registering procedure.       }
  193.                 {*} ListFile(CurrentDirName);
  194.  
  195.                 LastLevel:=LastTreeLevel;
  196.                 If LastLevel=1 Then
  197.                 begin
  198.                      Close(OutF);
  199.                      Exit;
  200.                 end;
  201.  
  202.                 DirAlreadyDoneList[LastTreeLevel-1]:= CurrentDirList[LastTreeLevel-1];
  203.                 CurrentDirList[LastTreeLevel-1]:='';
  204.                 For I:=LastLevel To 14 Do
  205.                 begin
  206.                      DirAlreadyDoneList[I]:='';
  207.                      CurrentDirList[I]:='';
  208.                 end;
  209.            end;
  210.      Until False;
  211. end;
  212.  
  213. Procedure Help;
  214. begin
  215.      WriteLn;
  216.      WriteLn(' Command Line:   DR95 S   or   DR95 R:savenum   or   DR95 L');
  217.      WriteLn;
  218.      WriteLn(' Where  S  means   Save the current configuration');
  219.      WriteLn('        R:savenum  Restore de configuration numbered ''savenum''');
  220.      WriteLn(' And    L          List de saved configurations''descriptions');
  221.      WriteLn;
  222. end;
  223.  
  224. Function ProgramDir:String;
  225. var Dummy, ProgramName: String;
  226.     I,J:Byte;
  227. begin
  228.      ProgramName:=ParamStr(0);
  229.      Dummy:='';
  230.      I:=Length(ProgramName);
  231.      Repeat I:=I-1 Until (ProgramName[I]='\') Or (I=1);
  232.      If I<>1 Then
  233.         For J:=1 To I Do Dummy:=Dummy+ProgramName[J];
  234.      ProgramDir:=Dummy;
  235. end;
  236.  
  237.  
  238. Function ListIndexedDescript(IndexNumber:Byte):String;
  239. var InF:Text;
  240.     DummyStr:String;
  241.     I:Byte;
  242. begin
  243.      If IndexNumber<=9 Then
  244.      begin
  245.           Assign(InF,ProgramDir+'DESCRIPT.DAT');
  246.           Reset(InF);
  247.           For I:=1 To IndexNumber Do ReadLn(InF,DummyStr);
  248.           ListIndexedDescript:=DummyStr;
  249.           Close(InF);
  250.      end else ListIndexedDescript:='';
  251. end;
  252.  
  253. Function Authorized(RestoreNumber:Byte):Boolean;
  254. var Car: Char;
  255. begin
  256.      WriteLn;
  257.      WriteLn('- WARNING -');
  258.      WriteLn('You''re about to restore a previous configuration described as :');
  259.      WriteLn(ListIndexedDescript(RestoreNumber));
  260.      WriteLn;
  261.      WriteLn('This operation would reset Windows 95 to its exact configuration at that time.');
  262.      WriteLn('Do you want to proceed anyway (Y/N)? ');
  263.      Car:=ReadKey;
  264.      If UpCase(Car)='Y' Then Authorized:=True Else Authorized:=False;
  265. end;
  266.  
  267. Procedure Comparelist(OldListName:String);
  268. var OldList,CurrentList,BlackList:Text;
  269.     OldStr,CurrentStr:String;
  270. begin
  271.      Assign(OldList,OldListName);
  272.      {$I-}Reset(OldList);{$I+}
  273.      If IOResult<>0 Then
  274.      begin
  275.           Help;
  276.           WriteLn('This configuration is missing or corrupt.');
  277.           WriteLn('Please try another ''savenum'' parameter.');
  278.           WriteLn;
  279.           Halt(0);
  280.      end;
  281.  
  282.      ListDir(ProgramDir);
  283.      WriteLn('Searching for added files...');
  284.  
  285.      Assign(CurrentList,ProgramDir+'LIST.TXT');
  286.      Reset(CurrentList);
  287.      Assign(BlackList,ProgramDir+'BLACK.TXT');
  288.      ReWrite(BlackList);
  289.  
  290.      Repeat
  291.            ReadLn(CurrentList,CurrentStr);
  292.            Reset(OldList);
  293.            Repeat
  294.                  ReadLn(OldList,OldStr);
  295.            Until (SameString(OldStr,CurrentStr)) Or (EOF(OldList));
  296.  
  297.            If Not(SameString(OldStr,CurrentStr)) Then
  298.            begin
  299.                 WriteLn('     '+CurrentStr);
  300.                 WriteLn(BlackList,CurrentStr);
  301.            end;
  302.  
  303.      Until EOF(CurrentList);
  304.  
  305.      Close(OldList);
  306.      Close(CurrentList);
  307.      Close(BlackList);
  308.      Erase(CurrentList);
  309.  
  310.      WriteLn('Deleting added files.');
  311.      Reset(BlackList);
  312.      While Not EOF(BlackList) Do
  313.      begin
  314.            ReadLn(BlackList,CurrentStr);
  315.            if CurrentStr<>'' Then DelFile(CurrentStr);
  316.      end;
  317.      Close(BlackList);
  318.      Erase(BlackList);
  319. end;
  320.  
  321.  
  322.  
  323. Function Windows( var HVersion, NVersion : integer ) : integer;
  324. const MULTIPLEX  = $2F;               { N° de l'interruption Multiplex }
  325.       NO_WIN     = $00;                            { Windows non actif }
  326.       W_386_X    = $01;                   { Windows /386 V2.X en cours }
  327.       W_REAL     = $81;              { Windows fonctionne en mode réel }
  328.       W_STANDARD = $82;          { Windows fonctionne en mode standard }
  329.       W_ENHANCED = $83;            { Windows fonctionne en mode étendu }
  330.  
  331. var regs : registers;         {* Registre pour l'appel d'interruption *}
  332.     Res  : integer;
  333.  
  334. {-- Cette fonction remplace l'appel de intr( $2F, Regs ) --------------}
  335. {-- Regs.ax = $1600 (Test d'installation du mode étendu), -------------}
  336. {-- l'appel avec la fonction Pascal renvois des valeurs erronées    ---}
  337.  
  338. function int2fcall : integer;
  339.  
  340. begin
  341.   inline( $b8 / $00 / $16 /             { mov   ax,1600h              *}
  342.           $cd / $2f /                   { int   2Fh                   *}
  343.           $89 / $46 / $FE );            { mov   [bp-2], ax            *}
  344.   { A cet endroit, le compilateur rajoute "mov ax, [bp-2]" pour       *}
  345.   { charger la variable de fonction locale dans le registre de retour *}
  346. end;
  347.  
  348. begin
  349.   HVersion := 0;                     { Initialise le numéro de version }
  350.   NVersion := 0;
  351.  
  352.             {-- Identifie Windows x.y en mode étendu ------------------}
  353.  
  354.   res := int2fcall;               { Test d'installation du mode étendu }
  355.  
  356.   case ( lo(Res) ) of
  357.     $01,
  358.     $FF:  begin
  359.             HVersion := 2;                        { Version principale }
  360.             NVersion := 0;               { Version secondaire inconnue }
  361.             Windows := W_386_X;
  362.           end;
  363.     $00,
  364.     $80:  begin
  365.             regs.ax := $4680;  { Identifier les modes Réel et Standard }
  366.             intr( MULTIPLEX, regs );
  367.             if ( regs.al = $80 ) then
  368.               Windows := NO_WIN            { Windows ne fonctionne pas }
  369.             else
  370.               begin
  371.                    {-- Windows en mode Réel ou Standard ---------------}
  372.  
  373.                 regs.ax := $1605;   { Simule l'inst. d'un DOS-Extender }
  374.                 regs.bx := $0000;
  375.                 regs.si := $0000;
  376.                 regs.cx := $0000;
  377.                 regs.es := $0000;
  378.                 regs.ds := $0000;
  379.                 regs.dx := $0001;
  380.                 intr( MULTIPLEX, regs );
  381.                 if ( regs.cx = $0000 ) then
  382.                   begin
  383.                      {-- Windows en mode Réel -------------------------}
  384.  
  385.                     regs.ax := $1606;
  386.                     intr( MULTIPLEX, regs );
  387.                     Windows := W_REAL;
  388.                   end
  389.                 else
  390.                   Windows := W_STANDARD;
  391.               end;
  392.           end;
  393.  
  394.    {-- Windows en mode Etendu, ax contient le numéro de version -------}
  395.  
  396.     else
  397.       begin
  398.         HVersion := lo(Res);          { Afficher la version de Windows }
  399.         NVersion := hi(Res);
  400.         Windows := W_ENHANCED;                { Windows en mode Etendu }
  401.       end;
  402.   end;
  403. end;
  404.  
  405. Procedure CreateDescript;
  406. var I:Byte;
  407.     OutF: Text;
  408. begin
  409.      Assign(OutF,ProgramDir+'DESCRIPT.DAT');
  410.      ReWrite(OutF);
  411.      For I:=1 To 9 Do WriteLn(OutF,'SAV.'+Chr(I+48)+' : no configuration saved');
  412.      Close(OutF);
  413. end;
  414.  
  415. Procedure RestoreDescript;
  416. var DirInfo:SearchRec;
  417.     InF,OutF:Text;
  418.     DummyStr:String;
  419.     I:Byte;
  420. begin
  421.      FindFirst(ProgramDir+'DESCRIPT.DAT',$FF,DirInfo);
  422.      If DosError<>0 Then CreateDescript Else
  423.      begin
  424.           Assign(InF,ProgramDir+'DESCRIPT.DAT');
  425.           Reset(InF);
  426.           Assign(OutF,ProgramDir+'TEMP.DAT');
  427.           ReWrite(OutF);
  428.           For I:=1 To 9 Do
  429.           begin
  430.               FindFirst(ProgramDir+'SAV.'+CHR(I+48),$FF,DirInfo);
  431.               If DosError=0 Then
  432.               begin
  433.                    ReadLn(InF,DummyStr);
  434.                    WriteLn(OutF,DummyStr);
  435.               end else
  436.               begin
  437.                    ReadLn(InF,DummyStr);
  438.                    WriteLn(OutF,'SAV.'+Chr(I+48)+' : no configuration saved');
  439.               end;
  440.           end;
  441.           Close(InF);
  442.           Close(OutF);
  443.           Erase(InF);
  444.           Rename(OutF,ProgramDir+'DESCRIPT.DAT');
  445.      end;
  446. end;
  447.  
  448. Procedure AddDescript(SaveDirName:String);
  449. var I,SaveNumber:Byte;
  450.     InF,OutF:Text;
  451.     Descript,DummyStr:String;
  452.  
  453. begin
  454.      Write('File Description for ',SaveDirName,' : ');
  455.      ReadLn(Descript);
  456.  
  457.      SaveNumber:=Ord(SaveDirName[Length(SaveDirName)-1])-48;
  458.      Assign(InF,ProgramDir+'DESCRIPT.DAT');
  459.      Reset(InF);
  460.      Assign(OutF,ProgramDir+'TEMP.DAT');
  461.      ReWrite(OutF);
  462.      For I:=1 To SaveNumber-1 Do
  463.      begin
  464.           ReadLn(InF,DummyStr);
  465.           WriteLn(OutF,DummyStr);
  466.      end;
  467.      ReadLn(InF,DummyStr);
  468.      WriteLn(OutF,'SAV.'+Chr(SaveNumber+48)+' : '+Descript);
  469.      For I:=SaveNumber+1 To 9 Do
  470.      begin
  471.           ReadLn(InF,DummyStr);
  472.           WriteLn(OutF,DummyStr);
  473.      end;
  474.  
  475.      Close(InF);
  476.      Close(OutF);
  477.      Erase(InF);
  478.      Rename(OutF,ProgramDir+'DESCRIPT.DAT');
  479. end;
  480.  
  481. Procedure ListDescript;
  482. var InF:Text;
  483.     DummyStr:String;
  484.     I:Byte;
  485. begin
  486.      Assign(InF,ProgramDir+'DESCRIPT.DAT');
  487.      Reset(InF);
  488.      WriteLn;
  489.      WriteLn('Saved configurations''descriptions :');
  490.      WriteLn;
  491.      For I:=1 To 9 Do
  492.      begin
  493.           ReadLn(InF,DummyStr);
  494.           WriteLn(DummyStr);
  495.      end;
  496.      WriteLn;
  497.      Close(InF);
  498. end;
  499.  
  500. Function GiveSaveDir(FileName:String):String; {Warning: just call once!}
  501. var Dummy: String;
  502.     I,J:Byte;
  503.     DirInfo: SearchRec;
  504. begin
  505.      Dummy:='';
  506.      I:=Length(FileName);
  507.      Repeat I:=I-1 Until (FileName[I]='\') Or (I=1);
  508.      If I<>1 Then
  509.         For J:=1 To I Do Dummy:=Dummy+FileName[J];
  510.  
  511.      I:=1;
  512.      FindFirst(Dummy+'SAV.'+Chr(49),$FF,DirInfo);
  513.      While ((DosError=0) and (I<9)) Do
  514.      begin
  515.           Inc(I);
  516.           FindFirst(Dummy+'SAV.'+Chr(48+I),$FF,DirInfo);
  517.      end;
  518.  
  519.      If I<9 Then
  520.      begin
  521.           MkDir(Dummy+'SAV.'+Chr(48+I));
  522.           GiveSaveDir:=Dummy+'SAV.'+Chr(48+I)+'\';
  523.      end else
  524.      begin
  525.           WriteLn('There are already nine configurations saved.');
  526.           WriteLn('Manually erase one of them before saving current configuration.');
  527.           WriteLn;
  528.           Halt(0);
  529.      end;
  530.      WriteLn;
  531.      WriteLn('Saving configuration in '+Dummy+'SAV.'+Chr(48+I)); {*}
  532. end;
  533.  
  534. Procedure CopyFile(FromFName,ToFName:String);
  535. var
  536.   FromF, ToF: File;
  537.   NumRead, NumWritten: Word;
  538.   Buf: Array[1..2048] of Char;
  539.   Attr: Word;
  540. begin
  541.      WriteLn('Copying ',FromFName,' to ',ToFName);  {*}
  542.      Assign(FromF, FromFName); { Open input file }
  543.      {$I-}
  544.      GetFAttr(FromF,Attr);
  545.      SetFAttr(FromF,$20);
  546.      Reset(FromF, 1);  { Record size = 1 }
  547.      Assign(ToF, ToFName); { Open output file }
  548.      Rewrite(ToF, 1);  { Record size = 1 }
  549.      Repeat
  550.            BlockRead(FromF, Buf, SizeOf(Buf), NumRead);
  551.            BlockWrite(ToF, Buf, NumRead, NumWritten);
  552.      Until (NumRead = 0) or (NumWritten <> NumRead);
  553.      Close(FromF);
  554.      Close(ToF);
  555.      SetFAttr(FromF,Attr);
  556.      SetFAttr(ToF,Attr);
  557.      {$I+}
  558. end;
  559.  
  560. Procedure SaveCurrentConfiguration;
  561. const FilesToSave : Array[1..4] of String =
  562.       ('WIN.INI',
  563.        'SYSTEM.INI',
  564.        'SYSTEM.DAT',
  565.        'USER.DAT');
  566.  
  567. var SaveDir: String;
  568.     I:Byte;
  569. begin
  570.      SaveDir:=GiveSaveDir(ParamStr(0));
  571.      AddDescript(SaveDir);
  572.  
  573.      ListDir(SaveDir);
  574.      For I:=1 To 4 Do CopyFile(Windir+FilesToSave[I],SaveDir+FilesToSave[I]);
  575. end;
  576.  
  577. Procedure RestoreConfiguration(DirName:String);
  578. const FilesToRestore: Array[1..4] of String =
  579.       ('WIN.INI',
  580.        'SYSTEM.INI',
  581.        'SYSTEM.DAT',
  582.        'USER.DAT');
  583. var DirInfo:SearchRec;
  584.     I:Byte;
  585. begin
  586.      For I:=1 To 4 Do
  587.      begin
  588.           FindFirst(WinDir+FilesToRestore[I],$FF,DirInfo);
  589.           If DosError=0 Then
  590.           begin
  591.                FindFirst(DirName+FilesToRestore[I],$FF,DirInfo);
  592.                If DosError=0 Then
  593.                begin
  594.                     DelFile(WinDir+FilesToRestore[I]);
  595.                     CopyFile(DirName+FilesToRestore[I],WinDir+FilesToRestore[I]);
  596.                end;
  597.           end;
  598.      end;
  599. end;
  600.  
  601. Procedure Intro;
  602. var Car1,Car2: String;
  603.     RestoreNumber:Byte;
  604.     HVersion, NVersion : integer;
  605. begin
  606.      ClrScr;
  607.      WriteLn('DR95.EXE - Drastical Restorer for Windows 95, VER 1.00');
  608.      WriteLn('Written by S.Fourmanoit, MCMXCVIII.');
  609.  
  610.      If Windows(HVersion, NVersion)<>$00 Then
  611.      begin
  612.           WriteLn;
  613.           WriteLn('Windows is currently running.');
  614.           WriteLn('This program cannot perform his job safely under Windows:');
  615.           WriteLn('please reboot your computer and press F8 in order to run in DOS mode.');
  616.           WriteLn; ReadLn;
  617.           Halt(0);
  618.      end;
  619.  
  620.      RestoreDescript;
  621.  
  622.      If ParamCount=0 Then
  623.      begin
  624.           Help;
  625.           Halt(0);
  626.      end;
  627.  
  628.      Car1:=Copy(ParamStr(1),1,1);
  629.      Case UpCase(Car1[1]) Of
  630.           'S': begin
  631.                     SaveCurrentConfiguration;
  632.                     WriteLn;
  633.                     WriteLn('Configuration sucessfully saved.');
  634.                     WriteLn;
  635.                end;
  636.           'R': begin
  637.                     Car2:=Copy(ParamStr(1),3,1);
  638.                     RestoreNumber:=Ord(Car2[1])-48;
  639.                     If Not (Car2[1] in ['1'..'9']) Then
  640.                     begin
  641.                          Help;
  642.                          WriteLn;
  643.                          WriteLn('Bad ''savenum''.  Please check the syntax.');
  644.                          WriteLn;
  645.                          Halt(0);
  646.                     end;
  647.  
  648.                     If Authorized(RestoreNumber) Then
  649.                     begin
  650.                          WriteLn;
  651.                          WriteLn('Restoring configuration #'+Car2[1]+'.');
  652.                          CompareList(ProgramDir+'SAV.'+Car2[1]+'\LIST.TXT');
  653.                          RestoreConfiguration(ProgramDir+'SAV.'+Car2[1]+'\');
  654.                          WriteLn;
  655.                          WriteLn('Restoration sucessfully done.');
  656.                          WriteLn;
  657.                     end else
  658.                     begin
  659.                          WriteLn;
  660.                          WriteLn('Operation aborded.');
  661.                          WriteLn;
  662.                          Halt(0);
  663.                     end;
  664.  
  665.                end;
  666.           'L': ListDescript;
  667.            else Help;
  668.      end;
  669. end;
  670.  
  671. {***  MAIN  ***}
  672. Begin
  673.      Intro;
  674. End.
  675.