How do I run other .EXE files from my pascal progg 
Author Message
 How do I run other .EXE files from my pascal progg

How do I run for example TEST.EXE from my Pascal program? Please answer!



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg

How do I run for example TEST.EXE from my pascal program? Please answer!



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg

Quote:
> How do I run for example TEST.EXE from my pascal program? Please answer!

   I'll answer this once (instead of 3 times like you posted this
question):

{$M 8192,0,0}
var I : integer;
...
  SwapVectors;
  Exec (GetEnv('COMSPEC'),'/C test');
  SwapVectors;
  I := DOSExitCode;
  if I <> 0 then writeln ('DOSExitCode failure: ',I);
  if DOSError <> 0 then writeln ('DOSError failure: ',DOSError)
...
   I suggest you look all the above up, to see what's being done and what
will occur when you alter any of it.



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg

        Exec(path,commandline:string)
--
Hilton Evans
***********************************************************
The two most important things in life are personal
health and time ... H.Evans 1995
**********************************************************
Chempen+ Chemical Structure Drawing
Software for Windows
http://www.ici.net/cust_pages/hfevans/chempen.htm



Quote:
> How do I run for example TEST.EXE from my pascal program? Please answer!



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg

Il giorno Thu, 18 Sep 1997 09:41:58 +0200, Jonas Bringberger

Quote:
>How do I run for example TEST.EXE from my pascal program? Please answer!

the correct syntax is

SwapVectors;
Exec(FileName, Parameters);    { FileName and Parameters obviusly are
strings}
SwapVectors;

And you must be careful to write in the first line of your program
something like :

{$M 8192, 0, 0}

8192 is invented by me : you should use the proper value for your
program (this is the stack size)

This avoids that all the memory is left to your program and leaves
enough space to run other processes.

Maybe that the program will not work if it runs into the IDE, cause
there is not enough memory.

Andrea Laforgia
--------------------------------------------------------
Tutto cio' che ho scritto sul rigo seguente e' falso
Tutto cio' che ho scritto sul rigo precedente e' falso
--------------------------------------------------------
"Grattatio pallarum omnia mala fugit" (Andrea Laforgia)
--------------------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg

--cut here--
begin
   command := 'test.exe'
        begin
        Swapvectors;
        Exec(GetEnv('COMSPEC'), '/C' + Command);
        Swapvector;
        if DosError <>0 then
              writeln('opss and error');  
        end;
end.

it worked for me!! and you wont get an error unless test.exe isnt
there, or there isnt enugh memory....

On Thu, 18 Sep 1997 09:40:14 +0200, Jonas Bringberger

Quote:

>How do I run for example TEST.EXE from my pascal program? Please answer!



Wed, 18 Jun 1902 08:00:00 GMT  
 How do I run other .EXE files from my pascal progg



Quote:
>--cut here--
>begin
>   command := 'test.exe'
>        begin
>       Swapvectors;
>       Exec(GetEnv('COMSPEC'), '/C' + Command);
>       Swapvector;
>       if DosError <>0 then
>             writeln('opss and error');  
>       end;
>end.

>it worked for me!! and you wont get an error unless test.exe isnt
>there, or there isnt enugh memory....

>On Thu, 18 Sep 1997 09:40:14 +0200, Jonas Bringberger

And make sure that you use the $M command to limit your heap or you will
have no free space to run a spawned program
--

In principle,   is there uncertainty that
Heisenberg was working his best in chaos?



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How do I run other .EXE files from my pascal progg

2. How can a .exe file runs in DOS has windows?(Made in Turbo Pascal)

3. running win95 exe file from pascal

4. How to run exe - Files out of my Application

5. Running External EXE files from a program [EXEC]

6. Running a batch or EXE file from a TP program

7. Running .EXE files from program

8. Relative speed of compiled exe files in BP 7 running under DOS, and in Delphi

9. running windows exe programs from Turbo Pascal

10. How run a program.exe at the end of a pascal program

11. running .exe and .bat from pascal

12. Appending exe to exe file

 

 
Powered by phpBB® Forum Software