home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / wpssafe1.zip / WPSsafe.cmd < prev    next >
OS/2 REXX Batch file  |  1994-01-29  |  2KB  |  58 lines

  1. @echo off
  2. SetLocal
  3. If (%1) == () Goto Help
  4.  
  5. Rem Env Var Name Usage/meaning                   Author's settings
  6. Rem ------------ ------------------------------- -------------------------
  7. Rem 'DeskVol'    The WPS desktop volume.         f:
  8. Rem 'Desktop'    The WPS desktop directory root. f:/Desktop/*
  9. Rem 'BootVol'    The OS/2 boot volume.           e:
  10. Rem 'SafeDir'    The safe target directory.      f:\Tahko\
  11. Rem 'DesktopTar' The TAR file name for desktop.  f:\Tahko\Desktop.%1.tar
  12. Rem 'SourceINIs' The two main INI files to copy. e:\OS2\OS2???.ini
  13. Rem 'TargetINIs' Target name for the two INIs.   f:\Tahko\OS2???.ini.%1
  14.  
  15. Rem Note: Only the 4 first environment variables below need
  16. Rem       to be modified for succesful operation of WPSsafe.
  17. Rem
  18. Set DeskVol=f:
  19. Set Desktop=%DeskVol%/Desktop/*
  20. Set BootVol=e:
  21. Set SafeDir=f:\Tahko\
  22.  
  23. Rem ...no need to modify these three...
  24. Set DesktopTar=%SafeDir%Desktop.%1.tar
  25. Set SourceINIs=%BootVol%\OS2\OS2???.ini
  26. Set TargetINIs=%SafeDir%OS2???.ini.%1
  27.  
  28. If (%2) == (!) Goto RESTORE
  29.  
  30. :BACKUP
  31. Tar -cppvf %DesktopTar% %Desktop%
  32. Copy %SourceINIs% %TargetINIs% /v
  33. Goto End
  34.  
  35. :RESTORE
  36. Rem  Here the source and target _seem_
  37. Rem  to be the wrong way. They are not.
  38. %DeskVol%
  39. cd\
  40. Tar -xppvf %DesktopTar%
  41. Copy %TargetINIs% %SourceINIs% /v
  42. Goto End
  43.  
  44. :Help
  45. Echo.
  46. Echo WPSsafe.cmd - Backup/restore WPS desktop and INI files.  Requires GTAK!
  47. Echo Release 1 of 17-Sep-93
  48. Echo Localized for Kari Mattsson on 17-Sep-93.
  49. Echo Copyright (c) 1993 Kari Mattsson. Released for Public Domain.
  50. Echo.
  51. Echo usage: WPSsafe {yymmdd} [!]
  52. Echo.
  53. Echo Note:  The option '!' restores the desktop and ini files.
  54. Echo        See WPSsafe.txt for limitation on the restoration.
  55.  
  56. :End
  57. EndLocal
  58.