# How to make two .exe files run simultaneously by clicking one exe file



## sridatta (Aug 7, 2006)

Hello guyz
I would like to know how to merge two executable files to a single executable file so that when i click that... both the exe files should run..
Currently i am working on Batch File Programming and for my application i need this...
Plzz help


----------



## Ishan (Aug 7, 2006)

you can use software named Auto It.
and ya it is based on script programming..
it is posted in this forum in tutorials section with name "Auotmate WinXP"
the link is
**www.thinkdigit.com/forum/showthread.php?t=27910*

its author black leopard has done the samething as u want. its a seconds work.


----------



## sridatta (Aug 8, 2006)

ye.. that was really sounding.. it worked.. and i have even got lot of xtra stuff from that article.. thank u...

but.. actual thing which i thought of is.. suppose if i want to run notepad.exe and calc.exe simultaneously, thn i need to merge or archive those exe files into another exe file so that even if i copy that new one into any other system, it s'd run...

if u ppl got me.. plzz help


----------



## Ishan (Aug 8, 2006)

Till other experts reply ..u can see to this..

Well if u really wanna deal with notepad and calc then the thing is their address wil hardly change if same OS and same drive..only drive letter may change  and u can edit the script for that..

and the other thing is that if u dont want to deal with the win programs but some other utilities then whichever software u use to accomplish ur work, u'll have to combine the exe files with the main exe file..so if u dont get that software..

then u can continue with this by just compiling the script in a folder which contains ur exe files..and then zip that folder create a self extractor and set some default folder location to unzip all files...
so that in the script u can write address of those exe files in that folder only...understood?

i doubt i confused u? ain't I?


----------



## sridatta (Aug 8, 2006)

Thank u Ishan...
That was really a gr8 idea.. 

but i dont want to disclose my other executable files.. that was my prblm..

One more idea of mine 
i have compiled a batch file script by including the other two exe files to an another exe file.. using Quick Batch File Compiler and it too worked.

i.e.. i mean to say.. i wrote a batch file script to run the two exe files and compiled the script including those two exe files which i desired to run. 

But the bad thing is.. the compiled exe file copies the included exe's into the current directory !! 

I think it is not possible to delete the files while running..


----------



## nishant_nms (Aug 8, 2006)

try using a batch file


----------



## sridatta (Aug 8, 2006)

nishant_nms said:
			
		

> try using a batch file


ya.. i have done that.. but i should not disclose any of my exe files while running  the main file.. pls refer to above posts


----------



## Ishan (Aug 8, 2006)

that is obvious..it willcopy the fles...but i didnt understood that what is current directory..

and more thing with my idea is that....there is no other chance except copying the two exe files with the main exe file....and if u sont want to disclose them then set the attributes to hidden..provided other pc has setting of not showing hidden files.

and pls explain me abt the current directory!! 
what i think u r trying to say with that the other two exe files are copied in the same folder where ur main exe files is extracted and u dont know how to extract them to other places through batch file script programming...correct?


----------



## sridatta (Aug 8, 2006)

Actually wht i m doin is...

Write a batch file script as

_start .\a.exe  ; To run Files  in the directory in which the exe file is running
start .\b.exe_

and i am using *quick batch file compiler* software which can compile the batch script by including the required exe files i.e. a.exe, b.exe. suppose my compiled exe file is say *final.exe*

now.. when i deploy this file to some other folder and run... then.. it will automatically extract *a.exe* and *b.exe* into the folder from where *final.exe* is running. After that.. it is executing both files. After the execution, the files a.exe and b.exe still remain in the directory. That was my problem. I cannot delete those files from batch file script by using

_del a.exe
del b.exe_ 

because the files are still running. 

nyhow.. i have succeded in doing this using AutoIt finally.. it has the command which during execution, copies the required files (here a.exe, b.exe) into desired destination folder. The files that are required are included automatically into the exe file while compiling.

_FileInstall("a.exe", "c:\WINDOWS\temp\1.bmp")_

This has partly solved my problem.


----------



## Ishan (Aug 8, 2006)

@sridatta...
so now what is the problem?

do u need something else?

or u dont want the script to install these files in some folder.

so what u want to do now?


@ all, i dont know y people give such replies...
 even i have done this but now onwards i wont! 

seee this..i read the forum rules today only and even want u utoo read them
*www.thinkdigit.com/forum/showthread.php?t=14617

and even see this in that
*# User reply is totally irrelevant to the post, for example...if user asks I have virus scanning problem in DAP and someone replies saying use flashget...so that’s what is called as useless reply and bad attempt to increase post count *("In General" forum is excluded)


----------



## sridatta (Aug 9, 2006)

I have got the required information. 
moderators.. please close the thread.


----------



## rohan (Aug 9, 2006)

you can create a similar program in C++


```
#include<windows.h>
#define PROGRAM1 "notepad.exe"
#define PROGRAM2 "pbrush.exe"

//Change the definitions to your convinience. Not sure whether just 'notepad.exe' will work or not...
//Please check it or use complete paths

int main(int argc, char *argv[]) {
   ShellExecute(NULL, "open", PROGRAM1, NULL, NULL, SW_SHOWNORMAL);
   ShellExecute(NULL, "open", PROGRAM2, NULL, NULL, SW_SHOWNORMAL);
}
```

Hope that works!!!


----------

