home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / SELFPR.ZIP / SELFPRG.DAT < prev    next >
Text File  |  1993-01-31  |  3KB  |  85 lines

  1. /*********************************************************************\
  2.    Set Object
  3.    (C) 1993 Jim Moriartey Compuserve 76330,1613
  4. \*********************************************************************/
  5.  
  6. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  7. call SysLoadFuncs
  8.  
  9. Call SETUP
  10. filelist='temp.lst'
  11. Qask ='N'
  12. gpara=""
  13. DO UNTIL Qask ='Y'
  14.  CLS
  15.   'Dir *.'unext '/f'
  16.    SAY ''
  17.     SAY 'Important all Names are CASE SENSITIVE'
  18.     SAY 'Enter file name to unpack'
  19.     SAY ' an example is TEST.ZIP'
  20.     PARSE PULL aname
  21.      SAY 'Enter Full Path and Drive where you want unpacked files Placed'
  22.      SAY ' an example is C:\OS2\TEST'
  23.      PARSE PULL adir
  24.       CLS
  25.       SAY 'Your Choices are the Following'
  26.       SAY ''
  27.       Say 'The FULL PATH and file name to unpack is :' dir aname
  28.       SAY ''
  29.       Say 'The FULL PATH to where you want the contents of the'
  30.       Say 'of the archive file placed is              :' adir
  31.       SAY ''
  32.       SAY 'Enter (Y or y) if Correct (Q or q) to Quit any other key to Re-Enter'
  33.        Pull Qask
  34.    If Qask = 'Q' then Exit
  35.  END
  36. sdrive = left(adir,2)
  37. sdrive
  38. 'MD ' adir
  39. 'CD ' adir
  40. zipper insert(dir,aname)
  41. "DIR /f > " filelist
  42.  
  43.  
  44. DO WHILE Lines(filelist)\=0
  45.     cmdline=Linein(filelist)
  46.     if right(cmdline,3)='cmd' then Call buildobject  
  47.     if right(cmdline,3)='CMD' then Call buildobject  
  48.     if right(cmdline,3)='bat' then Call buildobject  
  49.     if right(cmdline,3)='BAT' then Call buildobject
  50.     if right(cmdline,3)='com' then Call buildobject    
  51.     if right(cmdline,3)='COM' then Call buildobject  
  52.     if right(cmdline,3)='exe' then Call buildobject  
  53.     if right(cmdline,3)='EXE' then Call buildobject  
  54.     if right(cmdline,3)='inf' then Call buildinf
  55.     if right(cmdline,3)='INF' then Call buildinf 
  56.     
  57. END
  58.  
  59. EXIT
  60.  
  61. Buildobject:
  62. ototal =length(cmdline)-4
  63. spos=lastpos("\", cmdline)
  64. odir = substr(cmdline,1,spos-1)
  65. oname = substr(cmdline, spos+1, ototal-spos)
  66. Nogo = SysCreateObject( "WPProgram", oname, "<WP_DESKTOP>", "EXENAME="cmdline";STARTUPDIR="odir";PARAMETERS="gpara)
  67. if Nogo = 0 then say "The BUILD operation failed "
  68.                else say "Object Created"
  69. Return
  70.  
  71. Buildinf:
  72. viewvar='view.exe'
  73. gpara= cmdline
  74. ototal =length(cmdline)-4
  75. spos=lastpos("\", cmdline)
  76. odir = substr(cmdline,1,spos-1)
  77. oname = substr(cmdline, spos+1, ototal-spos)
  78. Nogo = SysCreateObject( "WPProgram", oname, "<WP_DESKTOP>", "EXENAME="viewvar";STARTUPDIR="odir";PARAMETERS="gpara)
  79. If Nogo = 0 then Say "The BUILD operation failed "
  80.                else Say "Object Created"
  81. Return
  82.  
  83.  
  84. SETUP:
  85.