home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / srtview2.zip / SORTVIEW.CMD < prev   
OS/2 REXX Batch file  |  1994-02-20  |  8KB  |  206 lines

  1. /*SORTVIEW.CMD-FEB 20,1994*/
  2. /*copyright (c) 1993-94 B.STONE,C>BLACK,KUTEK*/
  3. /*ALL RIGHTS RESERVED*/
  4. /*KUTEK, PO BOX 261, Forked River, NJ  08731*/
  5. /*USE AT YOUR OWN RISK,may not be sold or bundled*/
  6. /*FREE ONLY FOR PERSONAL USE BY INDIVIDUALS and BY EDUCATIONAL INSTITUTIONS */
  7. /*AS AN INTRODUCTION TO BLKOS2-ALL OTHERS CONTACT KUTEK*/
  8. /*SORTVIEW ALLOWS YOU TO SET THE NOTEBOOK SORT SETTINGS,*/
  9. /*THE NOTEBOOK BACKGROUND IMAGE SETTINGS AND THE */
  10. /*PERMANENT OPEN VIEW FOR FOLDERS FROM THE COMMANDLINE*/
  11. /*TYPE 'SORTVIEW' FOR HELP*/
  12. /*SUPPORTS HPFS AND LONGNAMES*/
  13. /*BACKUP YOUR EAS USING eg EABKUP21 FOR SAFETY !!!*/
  14. /*YOU WILL NEED TO KILL PMSHELL TO RESTART THE WPS TO GET*/
  15. /* SETTINGS TO TAKE EFFECT*/
  16. signal on ERROR name err
  17. trace(off)
  18. if rxfuncquery(sysloadfuncs) then do
  19. call RxFuncAdd 'SysLoadFuncs' , 'Rexxutil' , 'SysLoadFuncs'
  20. call SysLoadFuncs
  21. end
  22. ju=0;multi=0
  23. new.SOFF.1=x2c(0400710b18) x2c(00feffffff00000000fe) 5 1
  24. new.SNA.1=x2c(0400710b18) x2c(00feffffff01000000fe) 5 1
  25. new.SRN.1=x2c(0400710b18) x2c(00020000000100000002000000) 5 1
  26. new.STY.1=x2c(0400710b18) x2c(00ffffffff01000000ff) 5 1
  27. new.SSZ.1=x2c(0400710b18) x2c(00030000000100000003) 5 1
  28. new.SWD.1=x2c(0400710b18) x2c(00040000000100000004000000) 5 1
  29. new.SWT.1=x2c(0400710b18) x2c(00050000000100000005000000) 5 1
  30. new.SAD.1=x2c(0400710b18) x2c(00060000000100000006000000) 5 1
  31. new.SAT.1=x2c(0400710b18) x2c(00070000000100000007000000) 5 1
  32. new.SCD.1=x2c(0400710b18) x2c(00080000000100000008000000) 5 1
  33. new.SCT.1=x2c(0400710b18) x2c(00090000000100000009000000) 5 1
  34. new.I.1=x2c(04000b001c00) x2c(01) 6 1
  35. new.T.1=x2c(04000b001c00) x2c(65) 6 1
  36. new.D.1=x2c(04000b001c00) x2c(66) 6 1
  37. new.I.2=x2c(04000b001c00) x2c(44) 0-11
  38.  
  39. new.CO.1=x2c(0400730b180004) x2c(ecffffff000000002701320101) 0-18 1
  40. new.NOR.1=x2c(0400730b180004) x2c(ecffffff000000002801320114) 0-18 1
  41. new.TIL.1=x2c(0400730b180004) x2c(ecffffff000000002801330114) 0-18 1
  42. new.SCA.1=x2c(0400730b180004) x2c(ecffffff000000002801340101) 0-18 1
  43. new.1.1=x2c(0400730b180004) x2c(ecffffff000000002801340101) 0-18 1
  44.  
  45. call defeadat
  46. parse arg aa bb
  47. if aa=''|aa='?'|bb='' then call info
  48. if substr(aa,1,1)='"' then do;aa=aa||' '||bb
  49. parse var aa '"'aa'"' bb;end
  50. bb=translate(bb)
  51. if words(bb)=1&datatype(bb,'N') then do
  52. say ' YOU MUST SPECIFY SCA when using this parameter';exit;end
  53. if pos('@',aa)\=0 then do;multi=1
  54. parse var aa '@' filenam .
  55. do until lines(filenam)=0
  56. aa=linein(filenam);aa=strip(aa);if substr(aa,1,1)='"' then parse var aa '"' aa '"'
  57. cd=sysfiletree(aa,fgfg,'d')
  58. if fgfg.0\=1 then do;say aa;say 'NOT A FOLDER';iterate;end
  59. call chngdat;end;end;
  60. else do
  61. cd=sysfiletree(aa,fgfg,'d')
  62. if fgfg.0\=1 then do;say aa;say 'NOT A FOLDER';exit;end
  63. call chngdat;end
  64. exit
  65.  
  66. chngdat:
  67. if pos('CO',bb)>0|pos('SCA',bb)>0|pos('TIL',bb)>0,
  68. |pos('NOR',bb)>0|pos('IM',bb)>0 then ju=1
  69. drop ea
  70. s=sysgetea(aa,'.classinfo',ea)
  71. if s\=0 then do; call err;return;end
  72. if length(ea)<5|(ju=1&length(ea)<739) then do
  73. say 'adding default ea configuration to 'aa
  74. if ju=0 then data=defea1
  75. if ju=1 then data=defea2
  76. ress=sysputea(aa,'.CLASSINFO',data)
  77. ju=0
  78. if ress\=0 then do;call err;return;end
  79. drop ea;s=sysgetea(aa,'.classinfo',ea);end
  80. wt=ea
  81. do ky=1 to words(bb)
  82. key=word(bb,ky)
  83. if datatype(key,'N')\=1&new.key.1='NEW.'||key||'.1' then do
  84. say x2c(1b)'[1;5;31m' key 'IS AN INVALID SPEC'x2c(1b)'[0m';call info;end
  85. if datatype(key,'N') then iter=1
  86. else do;spec=words(new.key.1);iter=word(new.key.1,spec);end
  87. do i=1 to iter
  88. if datatype(key,'N')&key\=1 then do
  89. if key<16 then nu=0||d2x(key); else nu=d2x(key)
  90. sw='ECffffff'||nu||'00000028013401'||nu
  91. info=x2c(0400730b180004) x2c(sw) 0-18 1;end
  92. else info=new.key.i
  93. if word(info,3)='A' then do
  94. wripos=word(info,1);new=word(info,2);off1=0;end
  95. else do
  96. strin=word(info,1);new=word(info,2); off1=word(info,3)
  97. wripos=pos(strin,ea)
  98. wripos=wripos+off1;end
  99. len=length(new)
  100. str=delstr(wt,wripos,len)
  101. wt=insert(new,str,wripos-1)
  102. end
  103. end
  104. if length(wt)\=length(ea) then do
  105. say aa;say 'error setting attribute' ;return;end
  106. else res=sysputea(aa,'.classinfo',wt)
  107. if res=0 then say x2c(1b)'[1;32m'aa x2c(1b)'[0m'
  108. if res\=0 then say x2c(1b)'[1;31m'aa x2c(1b)'[0m'
  109. return
  110.  
  111. err:
  112. say x2c(1b)'[1;36m' aa x2c(1b)'[0m'
  113. say x2c(1b)'[1;31m AN ERROR HAS OCCURRED' x2c(1b)'[0m'
  114. if multi=0 then exit
  115. else return
  116.  
  117. info:
  118. say x2c(1b)'[1;33m'
  119. say 'SORTVIEW.CMD  copyright (c) 1993 B.Stone,C>Black,KUTEK'
  120. say 'all rights reserved-NOV 6,1993'
  121. say 'USAGE: SORTVIEW <FOLDERSPEC> <PARAMETERS> '
  122. say x2c(1b)'[1;32m'
  123. say 'where <FOLDERSPEC> is the path/name of a folder'
  124. say '(enclosed in double quotes for hpfs longnames)'
  125. say 'or a file path/name preceded by @ which contains a list'
  126. say 'of folder Paths/Names to be processed'
  127. say 'and <PARAMETERS> are any space delimited'
  128. say 'combination of the following in any order (case is irrelevant):'
  129. say
  130. say 'I-> set icon view'
  131. say 'T-> set tree view'
  132. say 'D->set details view'
  133. say 'CO->set solid color background'
  134. say 'NOR->set normal image background'
  135. say 'TIL->set tiled image background'
  136. say 'SCA->set scaled image background'
  137. say 'NN->number from 1 to 20 for the scale factor'
  138. say
  139. say '<<<<hit any key for more or ESC to exit>>>>'
  140. siu=sysgetkey('NOECHO')
  141. if siu=x2c(1B) then exit
  142. call syscls
  143.  
  144. say 'SOFF->turns Folder Sort OFF'
  145. say 'SNA->Sort by NAME'
  146. say 'STY->Sort by TYPE'
  147. say 'SRN->Sort by REAL NAME'
  148. say 'SSZ->Sort by SIZE'
  149. say 'SWD->Sort by LAST WRITE DATE'
  150. say 'SWT->Sort by LAST WRITE TIME'
  151. say 'SAD->Sort by LAST ACCESS DATE'
  152. say 'SAT->Sort by LAST ACCESS TIME'
  153. say 'SCD->Sort by CREATION DATE'
  154. say 'SCT->Sort by CREATION TIME'
  155. say
  156. say 'The ROOT Directory of a drive cannot be processed by this '
  157. say 'Program.You will need to restart the WPS using a kill utility,'
  158. say 'such as Killem, for settings to become active.'
  159. say x2c(1b)'[0m'
  160. exit
  161.  
  162. defeadat:
  163. def.1='FEFFC90080000000B80000005750466F6C6465720065890D0014890D00B6890D'
  164. def.2='00A8000000090044005750466F6C646572000400730B18000400300044005000'
  165. def.3='288030000000000000000000FFFFFFFF0400740B0200FFFF0400710B1800FEFF'
  166. def.4='FFFF00000000FEFFFFFF0000000000000000000000000900440057504F626A6'
  167. def.5='563740004000B001C00670000000000000009000000800000000000000000000'
  168. def.6='0000300000004000C000E00020032343635373540323000FFFF040004000800F'
  169. def.7='FFFFFFFFFFFFFFF000000000000'
  170. defea1=''
  171. do io=1 to 7
  172. defea1=defea1||def.io
  173. end
  174. defea1=x2c(defea1)
  175.  
  176. d2.1='FEFFED0280000000DC0200005750466F6C64657200898B0D0014890D00DA8B0D'
  177. d2.2='00CC020000090068025750466F6C6465720004006C0B1E0202000000286E6F6E'
  178. d2.3='6529004249544D41505C28737A4E6F6E65290000000000000000000000000000'
  179. d2.4='000000000000000000000000000000000000000000000000000000000000000'
  180. d2.5='0000000000000000000000000000000000000000000000000000000000000000'
  181. d2.6='0000000000000000000000000000000000000000000000000000000000000000'
  182. d2.7='0000000000000000000000000000000000000000000000000000000000000000'
  183. d2.8='000000000000000000000000000000000000000000000000000000000000000'
  184. d2.9='0000000000000000000000000000000000000000000000000000000000000000'
  185. d2.10='0000000000000000000000000000000000000000000000000000000000000000'
  186. d2.11='00433A5C4F53325C4249544D41505C5041545445524E5C28737A4E6F6E652900'
  187. d2.12='000000000000000000000000000000000000000000000000000000000000000'
  188. d2.13='0000000000000000000000000000000000000000000000000000000000000000'
  189. d2.14='0000000000000000000000000000000000000000000000000000000000000000'
  190. d2.15='0000000000000000000000000000000000000000000000000000000000000000'
  191. d2.16='000000000000000000000000000000000000000000000000000000000000000'
  192. d2.17='0000000000000000000000000000000000000000000000000000000000000000'
  193. d2.18='0000000000000000000000000000000000000000000000000000000000000000'
  194. d2.19='000000000000ECFFFFFF00000000280133010100000000000400730B18000400'
  195. d2.20='300044005000288030000000000000000000FFFFFFFF0400740B0200FFFF040'
  196. d2.21='0710B1800FEFFFFFF00000000FEFFFFFF0000000000000000000000000900440'
  197. d2.22='057504F626A6563740004000B001C00670000000000000009000000800000000'
  198. d2.23='0000000000000000300000004000C000E00020032323937333040323000FFFF0'
  199. d2.24='40004000800FFFFFFFFFFFFFFFF000000000000'
  200. defea2=''
  201. do no=1 to 24
  202. defea2=defea2||d2.no
  203. end
  204. defea2=x2c(defea2)
  205. return
  206.