Archive: How to run an exe in the background?


How to run an exe in the background?
Hi,
I need to run an exe in a hidden window. I first tried using exec but it throws up console windows on the screen for each exe I execute. so I tried using ExecShell I am confused with the action argument in the execshell, may I can know what other than "open" and "print" can be used in it to execute an image. One more thing I need to do is, one of the exe's I need to execute should wait for the previous exe execution to be completed, to do this I used ExecWait for the first exe, but I get a popup console window for this, how to avoid this popup.

-sarath.


Use one of DOS plug-ins, nsexec (Program files\nsis\contrib\nsexec) or my ExecDos http://forums.winamp.com/showthread....hreadid=201522 , both hide consol window and wait for process end. ExecDos also can give application login/password input.


Hi takhir,
Thanks for the reply. It worked. But one thing I am not able to see the progress for each of the exe being executed on the installfiles page.
Any inputs on this is highly appreciated.
--sarath.


I made changes both in ExecDos and nsExec, see attached package (2 dlls). This is not 'live output' (still in NSIS todo list), but 'Executing ...' appears on the instfiles page top.


I tried both of your dll's, what I exactly wanted was the progress bar movement(the blue bar which moves from 0% to 100% on completion) not the updatation of the strings on the Installfiles page, as I want to hide what is going on beyond the screens and just want to keep the user showing that the system is progressing.


Sarath, I understood what you want and wrote in the previous post that 'this is not live output'. But you will need time to do all as you want ;) I see 2 sides of your task.
1. I don't know how NSIS sets progress bar position, may be it simply calculates script line number (and on loops bar looks crazy :) ), but to make correct progress bar position changes (that is possible from script or plug-in) you must understand this algorithm, finally you should know bar 'borders' for nsExec (or ExecDos) step.
2-nd big question - your DOS application execution step-marks or execution time - also required for bar positioning inside 'borders'. IE often draws download progress bar by timer :)
Other words - I don't know ready decisions, task is not simple, but possible. You should be ready to spent much time on this (hours or days) :(


Hi Takhir,
Thanks for the messages, lets wait and see if somebody has a readymade solution.

Bbye.
--sarath


I doubt anyone already has a solution. This has never been asked before from my knowledge. If it's not on the NSIS Archive Downloads page then I doubt it exists.

-Stu


nsExec and execDos both hide the command windows but also wait until the application finishes. is there any solution to hide a window and get the behaviour of the simple "Exec" ?

I want to run two vbs files where the first waits itself for the other one. But if I use nsExec or execDos the first script will never finish!


Attached ExecDos worked with 2 applications in my test. In /ASYNC mode 'exec' call returns handle to control thread, this parameter helps to get exit code for this application in the 'wait' call (if required). Please find included Multi.nsi sample.