how to execute my exe before main exe ?

Hi
i have 2 exe file. first is main exe and second is my exe .
i want ..when end user run main exe . my exe first run and calculate some conditions if true then run main exe otherwise do not run main exe .
but how to do that



Answer this question

how to execute my exe before main exe ?

  • Ori'

    You COULD put the EXEs into resource files, and de-pack them to the harddrive then run them...

    There is always the chance that the user locks the exe from being deleted with the program is done though hmm.


  • SQLScott

    Hamed_1983 wrote:
    hi
    yes . your sugesstion is very good (combine Exe files)
    i want to combine exe files in 1 exe and when end user click that one exe all the exe files run at same time . but how to combine exe files



    Well lets see, I haven't tried this but... this is a guess, keep a backup of both projects:


    Delete program.cs from the 2nd project, take all elements and combine them

    Hopefully you don't use common names, even if you do it should be protected by namespaces.

    You should be able to start the main form of program 2 just like any other form.


  • ernieracer

    They would still run any other exe files except the third...

    As said, just combine the projects in 1 so you only have 1 project, 1 file, and that project can do whatever it wants.



  • shekhar saran

    Hi

    Why not to create a Third Exe file which will run the My.Exe first and then Main.Exe ....and the user will always click on Third.Exe



  • James. L.

    hi
    yes . your sugesstion is very good (combine Exe files)
    i want to combine exe files in 1 exe and when end user click that one exe all the exe files run at same time . but how to combine exe files



  • ridvan

    Why don't you combine them

    Becuase the user could always just run the 2nd exe.

    Why don't you combine them

    Becuase the user could always just run the 2nd exe.

                System.Diagnostics.Process obj_Process = new System.Diagnostics.Process();
                obj_Process.StartInfo.FileName = "c:\\text.txt";
                obj_Process.Start();

    That runs text.txt on my C drive so it should run whatever you put in there.

    I'm not sure what you have to clean up, and the txt file stays open after I close the program so... yeah.



  • how to execute my exe before main exe ?