home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / pcnt3v11.zip / pinstall.cmd < prev    next >
OS/2 REXX Batch file  |  1999-03-12  |  3KB  |  83 lines

  1. /*
  2.  
  3.    Setup objects for PPP connection on desktop.
  4.    Remember, info is taken from that set by 'Dial Other Provider'
  5.    '.ini' setup info. Do setup there first, try your connection
  6.    and then run this exec to create objects that do not use the SLIPPM
  7.    GUI interface to dial.
  8.    Then these PPP objects may be dragged to desktop context 'menu' tab
  9.    to create easier access.
  10.  
  11.    Example: If 'Dial Other Providers' shows an 'XYZ-Account'
  12.    then type:  pinstall XYZ-Account
  13.    This would create an object on the desktop in a random place
  14.    to start connection for XYZ-Account.
  15.  
  16.    To specify custom icons order is important ... stop, caution, go
  17.  
  18.  */
  19.  
  20.      Parse Arg acct stopicon cauticon goicon
  21.  
  22. /* if custom icons ALL must be set or default to traffic light */
  23.  
  24.          If(stopicon="")|(cauticon="")|(goicon="") Then
  25.  
  26.            Do
  27.              stopicon="redlight.ico"
  28.              cauticon="yellight.ico"
  29.              goicon  ="grelight.ico"
  30.            End
  31.  
  32.          Parse Source . . this .
  33.          this=Reverse(this)
  34.          Parse Var this . '\' cmdpath .
  35.          cmdpath=Reverse(cmdpath)
  36.  
  37.          Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  38.          Call SysLoadFuncs
  39.  
  40. /* make checks for TCPOS2, account and PPP function */
  41.  
  42.          inif=tcpchk(acct)
  43.          If(inif="") Then Exit 28
  44.  
  45. /* write icon names out to TCPOS2 for account */
  46.  
  47.          complete=FALSE
  48.  
  49.          If("ERROR:"=SysIni(inif,acct,"STOP",stopicon)) Then
  50.             Say "Error INI write stop tag"
  51.            Else
  52.  
  53.          If("ERROR:"=SysIni(inif,acct,"CAUTION",cauticon)) Then
  54.             Say "Error INI write caution tag"
  55.            Else
  56.  
  57.          If("ERROR:"=SysIni(inif,acct,"GO",goicon)) Then
  58.             Say "Error INI write go tag"
  59.            Else
  60.  
  61.          complete=TRUE
  62.  
  63.          If(FALSE=complete) Then
  64.            Do
  65.            Say "Error writing to ini file."
  66.            Exit 32
  67.            End
  68.  
  69. /* Create DESKTOP icon for account in random position */
  70.  
  71.          xc=Random(0,90,Time('S'))
  72.          yc=Random(0,90,Time('S'))
  73.  
  74.          setup='EXENAME='cmdpath'\pppcnt.cmd;PARAMETERS='acct '%'
  75.          setup=setup||';NOAUTOCLOSE=NO;MINIMIZED=YES;CCVIEW=NO;ICONFILE='cmdpath'\'stopicon';ICONPOS='xc yc
  76.  
  77.          result=SysCreateObject('WPProgram',acct,'<WP_DESKTOP>','OBJECTID=<PPPCNT_'Substr(acct,1,8)'>;'setup,'R')
  78.  
  79.          If(result) Then Say "Object created on desktop."
  80.           Else "Say difficulty creating Account object on desktop, result="result
  81.  
  82.         Exit
  83.