home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / goserv.zip / makeicon.cmd < prev    next >
OS/2 REXX Batch file  |  1995-01-28  |  2KB  |  65 lines

  1. /* MAKEICON.CMD -- make a program reference object (Icon) for GoServe  */
  2. /* ------------------------------------------------------------------- */
  3. /* This makes a GoServe program reference object on the desktop.       */
  4. /* It should be called from the GoServe program/working directory.     */
  5. /* ------------------------------------------------------------------- */
  6. /* Call as:  MAKEICON HTTP    /* For a Web server object */            */
  7. /*   or as:  MAKEICON GOPHER  /* For a Gopher server object */         */
  8. /* ------------------------------------------------------------------- */
  9. /* This program use the REXXUTIL library, part of OS/2 Rexx.           */
  10.  
  11. arg protocol .
  12. select
  13.   when protocol='HTTP' then do
  14.     type='Web';    parm='HTTP'
  15.     end
  16.   when protocol='GOPHER' then do
  17.     type='Gopher'; parm='Gopher'
  18.     end
  19.   otherwise
  20.     say 'MAKEICON.CMD must be called with the name of the protocol for which'
  21.     say 'you want a GoServe reference object created.  This must be either'
  22.     say '"HTTP" for a Web server or "GOPHER" for a Gopher server.  For example:'
  23.     say
  24.     say '  makeicon http'
  25.     say
  26.     exit 1
  27.   end /* select */
  28.  
  29. exe    ='GoServe.exe'
  30. dir    =directory()
  31. exefull=dir'\'exe
  32. title  ="GoServe -" type
  33.  
  34. /* Sanity check */
  35. if stream(exe, 'c', 'query exists')='' then do
  36.   say '"'exe'" does not seem to be in the directory that MAKEICON.CMD'
  37.   say 'was called from ['dir'].'
  38.   say 'Please correct and try again.'
  39.   exit 2; end
  40.  
  41. /* Now [try and] create the object, on the Desktop */
  42. call load /* load functions if necessary */
  43. call SysCreateObject "WPProgram", title, "<WP_DESKTOP>",,
  44.   "EXENAME="exefull";PARAMETERS="parm";PROGTYPE=PM;STARTUPDIR="dir";", "F"
  45. if result<>1 then do
  46.   say 'Sorry, for some reason the "'title'" object could not be created on'
  47.   say 'the Desktop.  Perhaps it already exists?'
  48.   exit result; end
  49.  
  50. /* OK, it worked */
  51. say 'The "'title'" object has been created on the Desktop.'
  52. say 'To have it started automatically when OS/2 is booted, make a shadow of the'
  53. say 'object in the Startup folder (hold down Ctrl+Shift while dragging it to'
  54. say 'the Startup Folder and dropping it there).'
  55. exit 0
  56.  
  57.  
  58. /* --- Load the function library, if necessary --- */
  59. load:
  60. if \RxFuncQuery("SysLoadFuncs") then return  /* already there */
  61. call RxFuncAdd "SysLoadFuncs","REXXUTIL","SysLoadFuncs"
  62. call SysLoadFuncs
  63. return
  64.  
  65.