(view source code of tasklist.cmd as plain text)
/*
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º TaskList last update: 31/07/99 º
º (C) 1997 - 1999, Rob van der Woude º
º Shows program names and types as OS/2's Tasklist does. º
º May be redirected to file or any standard input. º
º Use /? parameter to show help screen. º
º Use /A parameter to show "All" active processes. º
º Use /C parameter to show "all" in Continuous output. º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
*/
/* Initialize RexxUtil */
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs
if left( strip( strip( translate( arg( 1 ) ) ), "L", "/" ), 1 ) = "?" then do
call SysCls
say ""
say " TaskList"
say " displays a list of active programs"
say ""
say " Usage:"
say " TASKLIST [ /All | /Continuous ]"
say ""
say " The /A option will also display otherwise invisible processes."
say " The /C option will do the same AND pause after each screen."
say ""
say " Press any key . . ."
call SysCurState "OFF"
call SysGetKey "NOECHO"
exit
end
/* Initialize RexxLib */
call RxFuncAdd "RexxLibRegister", "RexxLib", "RexxLibRegister"
call RexxLibRegister
/* Definities */
progtype. = ""
ptype.0 = 7
ptype.1 = "OS/2 full screen"
ptype.2 = "OS/2 window"
ptype.3 = "PM"
ptype.4 = "DOS or Win-OS/2 full screen"
ptype.5 = "unknown"
ptype.6 = "unknown"
ptype.7 = "DOS or Win-OS/2 window"
all = 0
if left( strip( strip( translate( arg( 1 ) ) ), "L", "/" ), 1 ) = "A" then do
all = 1
end
continuous = 0
if left( strip( strip( translate( arg( 1 ) ) ), "L", "/" ), 1 ) = "C" then do
continuous = 1
all = 1
end
/* Find active processes */
call DosSwitchList "progtitle.", , , , "progtype.", "progvisible."
if progtitle.0 > 0 then do
call SysCls
screentitle = " Active programs: "||date( "E" )||" "||time( "N" )
say screentitle
say ""
i = 0
do j = 1 to progtitle.0
if progvisible.j = 4 | all = 1 then do
i = i + 1
say " Programma description : "||progtitle.j
type = progtype.j
ctype = ptype.type
if type = 0 then ctype = "System"
if progvisible.j <> 4 then ctype = "System"
say " Program type : "||ctype
say ""
if i = 7 & continuous = 0 then do
say " Press any key . . ."
call SysCurState "OFF"
call SysGetKey "NOECHO"
call SysCls
say screentitle
say ""
i = 0
end
end
end
if i > 0 & continuous = 0 then do
call SysCurPos 23, 0
say " Druk op een toets . . ."
call SysCurState "OFF"
call SysGetKey "NOECHO"
end
end
page last modified: 2024-04-16; loaded in 0.0060 seconds