Execing under Windows

I need to execute EXE files from my TP program - under Windows 95...

TP's exec isn't working. I've tried COMMAND.COM /C filename.ext but that

isn't working too...

Please help if you've got any idea


Thanx


Comments

  • What kind of error is Mem giving you? Will the following

    snipet of code not work?




    Program runprog;

    Uses Dos;

    {$M 4000,0,0}
    const

    FileName = 'TARGET.EXE';
    begin;

    Exec(FileName,'');

    end.


    URL:http://acheronx.ml.org/home/

  • I'm using an exec routine written by someone for SWAG.

    It uses command /c and before executing it sets heap

    to the maximal possible size. I've made a prg that uses

    this routine and only executes the program that was given

    as a command line parameter. It works fine,but when

    i add the routine in my own prg it gives me the error

    "Access denied".The two prgs are using the same memory

    settings,the same compiling directives so i don't

    understand why isn't it working in both of them.


  • : I'm using an exec routine written by someone for SWAG.

    : It uses command /c and before executing it sets heap

    : to the maximal possible size. I've made a prg that uses

    : this routine and only executes the program that was given

    : as a command line parameter. It works fine,but when

    : i add the routine in my own prg it gives me the error

    : "Access denied".The two prgs are using the same memory

    : settings,the same compiling directives so i don't

    : understand why isn't it working in both of them.


    Because this routine is purely DOS-only!

    No stack routines(atleast the dirty ones)that i

    have seen.. use this code instead:


    Program Exec;


    Uses WinDOS,WinCRT;


    Begin

    SwapVectors;

    Exec(GetEnv('COMMAND'), '/C '+'PROGRAM.EXE');

    SwapVectors;

    End.


    if this does not work, get new version,

    or seek for psyciatric help.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories