home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / makeurl.zip / MAKEURL.CMD
OS/2 REXX Batch file  |  1996-04-03  |  2KB  |  81 lines

  1. /* */
  2. Call RxFuncAdd 'SysLoadFuncs','REXXUTIL','SysLoadFuncs';
  3. Call SysLoadFuncs;
  4.  
  5. exp = 'explore.ini'
  6.  
  7. /*  May need to change if desktop at C:\Desktop */
  8. call syscls
  9. say 'Location of Desktop? (Defaults to C:\Desktop): ';
  10. pull desktop
  11.  
  12. desktop=STRIP(desktop)
  13. if desktop='' then desktop='C:\Desktop'
  14.  
  15.  
  16. /*    Create a folder on the desktop    */
  17. where = '<WP_DESKTOP>'
  18. ftitle = "URL Folder"
  19. vals = 'OBJECTID=<Test>'
  20. ret = SysCreateObject(WPFolder, ftitle, where, vals);
  21. obj.path = desktop || '\' || ftitle
  22.  
  23. /*    Find the location of the explore.ini file    */
  24.  
  25. env = 'OS2ENVIRONMENT'
  26. expfile = value('etc',,env)
  27. if file = '' then
  28. do
  29.   say 'Cannot find the TCP/IP etc environment'
  30.   exit
  31. end
  32. expfile = expfile || '\' || exp
  33.  
  34. do forever
  35.   x = linein(expfile);
  36.   if x = "[quicklist]" then
  37.     leave
  38. end
  39. count = 0;
  40. bad.0 = 0;
  41. bcount = 0;
  42. do forever
  43.   obj.title = linein(expfile);
  44.   obj.url   = linein(expfile);
  45.   if obj.title = "" then
  46.     leave;
  47.   count = count + 1;
  48.   parse var obj.title 'quicklist= ' obj.title
  49.   nfixed = translate(obj.title,'!','/');
  50.   nfixed = translate(nfixed,'!',':');
  51.   ofile = obj.path || '\' || nfixed;
  52.   rc=SysCreateObject("WebExplorer_Url", obj.title, obj.path);
  53.   if STREAM(ofile,'C','QUERY EXISTS') = "" then
  54.   do
  55.     bcount = bcount + 1;
  56.     bad.bcount = obj.title
  57.   end
  58.   xx = charout(ofile, obj.url );
  59.  
  60.   if xx \= 0 then
  61.   do
  62.     say "cannot write to " ofile
  63.     bcount = bcount + 1;
  64.     bad.bcount = obj.title
  65.   end
  66.   call stream ofile, 'C', 'CLOSE'
  67. end
  68. say "Created " count "URL's from the explore.ini file"
  69. exit
  70.  
  71. if bcount = 0 then
  72.   exit;
  73. say bcount "URL's were created that did not have their links added to them"
  74. say "These URL's are:"
  75.  
  76. do x = 1 to bcount
  77.   say '  'bad.x
  78. end
  79.  
  80.  
  81.