Memory problems using Exec command.
Posted on 2001-06-07
I'm creating a bootdisk (DOS) and I wrote a Graphical interface in Pascal. I use a lot of external tools wich are loaded with Exec command. But these programs don't release their memory (I think?) Is there a way to clear the memory of the programs executed so there's room for other programs?
The problem is my network-drivers need to be loaded (at the end) but the net.exe tells me (Error 8 not enough memory)
I already lowered the heapsize to 60,000.
I'm not familiar with assembler and I have no clue how to overcome my problem. Can someone help me? I only have 75 points to give away. (A friend of mine recommended this site) and I just signed up. I will give away more points (hopefully) in the future.
Function ShellCommand(Command : String) : Integer;
Redirect : Boolean;
OutputTo : String;
Redirect := (Pos('>', Command) <> 0);
If Redirect Then
OutputTo := ''
OutputTo := ' >nul';
Exec(GetEnv('COMSPEC'), '/C ' + Command + OutputTo);
ShellCommand := DosError;