home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / joevw122.zip / LOCKUP_I.CMD < prev    next >
OS/2 REXX Batch file  |  1993-07-13  |  2KB  |  57 lines

  1. /* rexx */
  2. /* This rexx utility is for use with JoeView, version 1.2 or greater*/
  3. /* This particular example is setup for making a random lockup screen image */
  4. /*  You will need to setup the lockup screen setting for your system to the correct */
  5. /*  file that you indicate at the end of this file */
  6. /*  I have this being executed in my startup.cmd file for a background image and */
  7. /*  by the alarm utility (or cron) every few hours for my lockup screen */
  8. /*  You can also use a similar file and put it in your startup.cmd to have a new */
  9. /*  background image each time you startup your computer */
  10. '@echo off'
  11.  
  12. /*You may need to uncomment the following 7 lines if your use the alarm command*/
  13. /*to launch this file or you have a cron command that won't automatically minimize*/
  14. /*this file*/
  15.  
  16. /*parse upper arg detach_me*/
  17. /*if detach_me <> "DETACH" then*/
  18. /*   do*/
  19. /*      cmd = "start /min lockup_image detach"*/
  20. /*      cmd*/
  21. /*      exit*/
  22. /*   end*/
  23.  
  24. '@echo on'
  25. call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  26. call SysLoadFuncs
  27.  
  28. which_one = random(1, 990)   /* Seeding the random function a little */
  29. which_one = random(3, 789)
  30. which_one = random(6, 234)
  31. /*Choose a directory, this example weights the odds towards one particular directory */
  32.  
  33. which_one = random(1,5)  
  34. if which_one = 1 then
  35.    change_direct = directory("e:\images\g")          /*put your path here */
  36. else
  37.    change_direct = directory("e:\images\pg")
  38.  
  39. /*Looking for jpegs only, change to other file format to suit your setup */
  40. call SysFileTree "*.jpg",  "files", "F"
  41. which_one = random(1,files.0)   /*Choose a random file */
  42. fullpath = substr(files.which_one, 38)  /*The 38 is extra info in front of file name */
  43. drive    = filespec("drive", fullpath)
  44. path     = filespec("path", fullpath)
  45. fullname = filespec("name", fullpath)
  46. dotpos   = lastpos(".", fullname)
  47.  
  48. /* put your path to joeview here */
  49. /* You will need to change the lockup screen's file to agree with whatever you
  50.     specify here.  I.E. replace c:\os2\bitmap\lockup.bmp with whatever file you have
  51.     indicated in the main settings lockup image option */
  52.   cmd = "c:\os2\util\joeview -bs " fullpath " c:\os2\bitmap\lockup.bmp"
  53.   cmd 
  54.   cmd = 'exit'
  55.   cmd
  56. exit
  57.