home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
srtview2.zip
/
SORTVIEW.CMD
< prev
Wrap
OS/2 REXX Batch file
|
1994-02-20
|
8KB
|
206 lines
/*SORTVIEW.CMD-FEB 20,1994*/
/*copyright (c) 1993-94 B.STONE,C>BLACK,KUTEK*/
/*ALL RIGHTS RESERVED*/
/*KUTEK, PO BOX 261, Forked River, NJ 08731*/
/*USE AT YOUR OWN RISK,may not be sold or bundled*/
/*FREE ONLY FOR PERSONAL USE BY INDIVIDUALS and BY EDUCATIONAL INSTITUTIONS */
/*AS AN INTRODUCTION TO BLKOS2-ALL OTHERS CONTACT KUTEK*/
/*SORTVIEW ALLOWS YOU TO SET THE NOTEBOOK SORT SETTINGS,*/
/*THE NOTEBOOK BACKGROUND IMAGE SETTINGS AND THE */
/*PERMANENT OPEN VIEW FOR FOLDERS FROM THE COMMANDLINE*/
/*TYPE 'SORTVIEW' FOR HELP*/
/*SUPPORTS HPFS AND LONGNAMES*/
/*BACKUP YOUR EAS USING eg EABKUP21 FOR SAFETY !!!*/
/*YOU WILL NEED TO KILL PMSHELL TO RESTART THE WPS TO GET*/
/* SETTINGS TO TAKE EFFECT*/
signal on ERROR name err
trace(off)
if rxfuncquery(sysloadfuncs) then do
call RxFuncAdd 'SysLoadFuncs' , 'Rexxutil' , 'SysLoadFuncs'
call SysLoadFuncs
end
ju=0;multi=0
new.SOFF.1=x2c(0400710b18) x2c(00feffffff00000000fe) 5 1
new.SNA.1=x2c(0400710b18) x2c(00feffffff01000000fe) 5 1
new.SRN.1=x2c(0400710b18) x2c(00020000000100000002000000) 5 1
new.STY.1=x2c(0400710b18) x2c(00ffffffff01000000ff) 5 1
new.SSZ.1=x2c(0400710b18) x2c(00030000000100000003) 5 1
new.SWD.1=x2c(0400710b18) x2c(00040000000100000004000000) 5 1
new.SWT.1=x2c(0400710b18) x2c(00050000000100000005000000) 5 1
new.SAD.1=x2c(0400710b18) x2c(00060000000100000006000000) 5 1
new.SAT.1=x2c(0400710b18) x2c(00070000000100000007000000) 5 1
new.SCD.1=x2c(0400710b18) x2c(00080000000100000008000000) 5 1
new.SCT.1=x2c(0400710b18) x2c(00090000000100000009000000) 5 1
new.I.1=x2c(04000b001c00) x2c(01) 6 1
new.T.1=x2c(04000b001c00) x2c(65) 6 1
new.D.1=x2c(04000b001c00) x2c(66) 6 1
new.I.2=x2c(04000b001c00) x2c(44) 0-11
new.CO.1=x2c(0400730b180004) x2c(ecffffff000000002701320101) 0-18 1
new.NOR.1=x2c(0400730b180004) x2c(ecffffff000000002801320114) 0-18 1
new.TIL.1=x2c(0400730b180004) x2c(ecffffff000000002801330114) 0-18 1
new.SCA.1=x2c(0400730b180004) x2c(ecffffff000000002801340101) 0-18 1
new.1.1=x2c(0400730b180004) x2c(ecffffff000000002801340101) 0-18 1
call defeadat
parse arg aa bb
if aa=''|aa='?'|bb='' then call info
if substr(aa,1,1)='"' then do;aa=aa||' '||bb
parse var aa '"'aa'"' bb;end
bb=translate(bb)
if words(bb)=1&datatype(bb,'N') then do
say ' YOU MUST SPECIFY SCA when using this parameter';exit;end
if pos('@',aa)\=0 then do;multi=1
parse var aa '@' filenam .
do until lines(filenam)=0
aa=linein(filenam);aa=strip(aa);if substr(aa,1,1)='"' then parse var aa '"' aa '"'
cd=sysfiletree(aa,fgfg,'d')
if fgfg.0\=1 then do;say aa;say 'NOT A FOLDER';iterate;end
call chngdat;end;end;
else do
cd=sysfiletree(aa,fgfg,'d')
if fgfg.0\=1 then do;say aa;say 'NOT A FOLDER';exit;end
call chngdat;end
exit
chngdat:
if pos('CO',bb)>0|pos('SCA',bb)>0|pos('TIL',bb)>0,
|pos('NOR',bb)>0|pos('IM',bb)>0 then ju=1
drop ea
s=sysgetea(aa,'.classinfo',ea)
if s\=0 then do; call err;return;end
if length(ea)<5|(ju=1&length(ea)<739) then do
say 'adding default ea configuration to 'aa
if ju=0 then data=defea1
if ju=1 then data=defea2
ress=sysputea(aa,'.CLASSINFO',data)
ju=0
if ress\=0 then do;call err;return;end
drop ea;s=sysgetea(aa,'.classinfo',ea);end
wt=ea
do ky=1 to words(bb)
key=word(bb,ky)
if datatype(key,'N')\=1&new.key.1='NEW.'||key||'.1' then do
say x2c(1b)'[1;5;31m' key 'IS AN INVALID SPEC'x2c(1b)'[0m';call info;end
if datatype(key,'N') then iter=1
else do;spec=words(new.key.1);iter=word(new.key.1,spec);end
do i=1 to iter
if datatype(key,'N')&key\=1 then do
if key<16 then nu=0||d2x(key); else nu=d2x(key)
sw='ECffffff'||nu||'00000028013401'||nu
info=x2c(0400730b180004) x2c(sw) 0-18 1;end
else info=new.key.i
if word(info,3)='A' then do
wripos=word(info,1);new=word(info,2);off1=0;end
else do
strin=word(info,1);new=word(info,2); off1=word(info,3)
wripos=pos(strin,ea)
wripos=wripos+off1;end
len=length(new)
str=delstr(wt,wripos,len)
wt=insert(new,str,wripos-1)
end
end
if length(wt)\=length(ea) then do
say aa;say 'error setting attribute' ;return;end
else res=sysputea(aa,'.classinfo',wt)
if res=0 then say x2c(1b)'[1;32m'aa x2c(1b)'[0m'
if res\=0 then say x2c(1b)'[1;31m'aa x2c(1b)'[0m'
return
err:
say x2c(1b)'[1;36m' aa x2c(1b)'[0m'
say x2c(1b)'[1;31m AN ERROR HAS OCCURRED' x2c(1b)'[0m'
if multi=0 then exit
else return
info:
say x2c(1b)'[1;33m'
say 'SORTVIEW.CMD copyright (c) 1993 B.Stone,C>Black,KUTEK'
say 'all rights reserved-NOV 6,1993'
say 'USAGE: SORTVIEW <FOLDERSPEC> <PARAMETERS> '
say x2c(1b)'[1;32m'
say 'where <FOLDERSPEC> is the path/name of a folder'
say '(enclosed in double quotes for hpfs longnames)'
say 'or a file path/name preceded by @ which contains a list'
say 'of folder Paths/Names to be processed'
say 'and <PARAMETERS> are any space delimited'
say 'combination of the following in any order (case is irrelevant):'
say
say 'I-> set icon view'
say 'T-> set tree view'
say 'D->set details view'
say 'CO->set solid color background'
say 'NOR->set normal image background'
say 'TIL->set tiled image background'
say 'SCA->set scaled image background'
say 'NN->number from 1 to 20 for the scale factor'
say
say '<<<<hit any key for more or ESC to exit>>>>'
siu=sysgetkey('NOECHO')
if siu=x2c(1B) then exit
call syscls
say 'SOFF->turns Folder Sort OFF'
say 'SNA->Sort by NAME'
say 'STY->Sort by TYPE'
say 'SRN->Sort by REAL NAME'
say 'SSZ->Sort by SIZE'
say 'SWD->Sort by LAST WRITE DATE'
say 'SWT->Sort by LAST WRITE TIME'
say 'SAD->Sort by LAST ACCESS DATE'
say 'SAT->Sort by LAST ACCESS TIME'
say 'SCD->Sort by CREATION DATE'
say 'SCT->Sort by CREATION TIME'
say
say 'The ROOT Directory of a drive cannot be processed by this '
say 'Program.You will need to restart the WPS using a kill utility,'
say 'such as Killem, for settings to become active.'
say x2c(1b)'[0m'
exit
defeadat:
def.1='FEFFC90080000000B80000005750466F6C6465720065890D0014890D00B6890D'
def.2='00A8000000090044005750466F6C646572000400730B18000400300044005000'
def.3='288030000000000000000000FFFFFFFF0400740B0200FFFF0400710B1800FEFF'
def.4='FFFF00000000FEFFFFFF0000000000000000000000000900440057504F626A6'
def.5='563740004000B001C00670000000000000009000000800000000000000000000'
def.6='0000300000004000C000E00020032343635373540323000FFFF040004000800F'
def.7='FFFFFFFFFFFFFFF000000000000'
defea1=''
do io=1 to 7
defea1=defea1||def.io
end
defea1=x2c(defea1)
d2.1='FEFFED0280000000DC0200005750466F6C64657200898B0D0014890D00DA8B0D'
d2.2='00CC020000090068025750466F6C6465720004006C0B1E0202000000286E6F6E'
d2.3='6529004249544D41505C28737A4E6F6E65290000000000000000000000000000'
d2.4='000000000000000000000000000000000000000000000000000000000000000'
d2.5='0000000000000000000000000000000000000000000000000000000000000000'
d2.6='0000000000000000000000000000000000000000000000000000000000000000'
d2.7='0000000000000000000000000000000000000000000000000000000000000000'
d2.8='000000000000000000000000000000000000000000000000000000000000000'
d2.9='0000000000000000000000000000000000000000000000000000000000000000'
d2.10='0000000000000000000000000000000000000000000000000000000000000000'
d2.11='00433A5C4F53325C4249544D41505C5041545445524E5C28737A4E6F6E652900'
d2.12='000000000000000000000000000000000000000000000000000000000000000'
d2.13='0000000000000000000000000000000000000000000000000000000000000000'
d2.14='0000000000000000000000000000000000000000000000000000000000000000'
d2.15='0000000000000000000000000000000000000000000000000000000000000000'
d2.16='000000000000000000000000000000000000000000000000000000000000000'
d2.17='0000000000000000000000000000000000000000000000000000000000000000'
d2.18='0000000000000000000000000000000000000000000000000000000000000000'
d2.19='000000000000ECFFFFFF00000000280133010100000000000400730B18000400'
d2.20='300044005000288030000000000000000000FFFFFFFF0400740B0200FFFF040'
d2.21='0710B1800FEFFFFFF00000000FEFFFFFF0000000000000000000000000900440'
d2.22='057504F626A6563740004000B001C00670000000000000009000000800000000'
d2.23='0000000000000000300000004000C000E00020032323937333040323000FFFF0'
d2.24='40004000800FFFFFFFFFFFFFFFF000000000000'
defea2=''
do no=1 to 24
defea2=defea2||d2.no
end
defea2=x2c(defea2)
return