Category : Files from Magazines
Archive   : VOL8N1.ZIP
Filename : EXECDEMO.PAS
Output of file : EXECDEMO.PAS contained in archive : VOL8N1.ZIP
PROGRAM Exec_Demo;
(*By Neil J. Rubenking*)
(*Demonstrates the use of new TP 5.0 routines *)
(*to enhance the EXEC procedure. *)
USES Dos;
VAR
WhatProg, Found : PathStr;
BEGIN
Write('Enter the program name just as you');
WriteLn(' would at the DOS prompt, with NO');
Write('extension and NO path. It can be a ');
WriteLn('COM, EXE, or BAT file.');
Write('Program name:');
ReadLn(WhatProg);
Found := FSearch(WhatProg+'.COM','');
IF Found = '' THEN
Found := FSearch(WhatProg+'.EXE','');
IF Found = '' THEN
Found := FSearch(WhatProg+'.BAT','');
IF Found = '' THEN
Found := FSearch(WhatProg+'.COM', GetEnv('PATH'));
IF Found = '' THEN
Found := FSearch(WhatProg+'.EXE', GetEnv('PATH'));
IF Found = '' THEN
Found := FSearch(WhatProg+'.BAT', GetEnv('PATH'));
IF Found = '' THEN
BEGIN
WriteLn('Sorry, I cannot find "',WhatProg,'" anywhere!');
Halt(1);
END;
Found := FExpand(Found);
WriteLn('Press
ReadLn;
SwapVectors;
IF Pos('.BAT',Found) > 0 THEN
EXEC(GetEnv('COMSPEC'),'/C '+Found)
ELSE
EXEC(Found,'');
SwapVectors;
CASE DosError OF
0 : WriteLn('Successful completion');
1 : WriteLn('Invalid function');
2 : WriteLn('File not found or path invalid.');
5 : WriteLn('Access denied.');
8 : WriteLn('Insufficient memory.');
END;
END.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/