hello, can any 1 please help/guide me for creating an program .exe file in C. as i am using Dev c++ compiler.say for E.g( program of addition in this by compiling & running it i get the required output. but if i dont want to run the program again n again in c code.instead of it i just create 1 exe file so that when i double click it. it automatically runs & produces the required output.although the s/w itself produces the exe file. but it opens along with all the supported/assosciated files with it. i just require only 1 exe file.

Re: create a program exe file in C. 80 80

The exe file is created automatically when you run your program. It is located in the same directory where your source file resides.

Re: create a program exe file in C. 80 80

Isn't it created when you compile, your program, saad749?

I don't use that compiler but there should be a specific directory (maybe debug or release) where your .exe is being produced on compilation.

You can execute that file just like any other executable.

Re: create a program exe file in C. 80 80

Yes, the exe file is created the moment program is compiled. It is created in the same directory as the source file.

Re: create a program exe file in C. 80 80

yes it is been created in the same project directory.bt i want the exe file to be seperated from others its associated file. means all the assosciated file should reside inside it & not outside of it.it cant be open without that assosciated file.

Re: create a program exe file in C. 80 80

When you compile a program the compiler generates the executable program that is usually self-contained except maybe for a few operating system shared libraries and DLLs. You can move the executable program any where you wish on your computer and it will normally run without problems. The source files (*.cpp and *.h) are not needed after they have been compiled. The compiler puts the exe file in the same folder as the source files only for your convenience.

Re: create a program exe file in C. 80 80

BTW if u r using image file or other external files you will need to move the respected files along with the exe file. The Source and header files as MENTIONED ABOVE are NOT NEEDED.

Re: create a program exe file in C. 80 80

now i wan the exe to be secured that is no body can cm to know that it is a c compiler file. only the source can cm to know that it is file assosciated with itself.rt nw it is creating a exe file on which double click produces the required output. i wan only the producer of that exe file can run it. else nobody can cm to about it.

Re: create a program exe file in C. 80 80

Just don't give the exe file to anybody then :-/. Just give away the .c file to someone.

Re: create a program exe file in C. 80 80

now i wan the exe to be secured that is no body can cm to know that it is a c compiler file. only the source can cm to know that it is file assosciated with itself.rt nw it is creating a exe file on which double click produces the required output. i wan only the producer of that exe file can run it. else nobody can cm to about it.

Can you retype that? I'm really not understanding this :s
Are you saying you want to hide the .exe separate from the source file?

Re: create a program exe file in C. 80 80

No -- he is saying he wants to hide the program from everyone except himself -- sounds pretty malicious to me. It's not even possible on MS-Windows because anyone with Admin privaledges can view every program in the system. Programs can not be hidden from Admins or antivirus programs, and for good reason.

Re: create a program exe file in C. 80 80

Then Use a file locker program for that, :P

Re: create a program exe file in C. 80 80

Sadly, FolderSafe is not compatible with 64-bit Windows 7. I was going to install it on my computer to see how good or bad it is but it doesn't work.

Re: create a program exe file in C. 80 80

The best and simplest way to keep data private is to put the data on a flash drive (or usb drive) so that you can remove it from the computer when you are not working with it.

Re: create a program exe file in C. 80 80

" i just create 1 exe file so that when i double click it. it automatically runs & produces the required output.although the s/w itself produces the exe file. but it opens along with all the supported/assosciated files with it. i just require only 1 exe file. "

i think kapil wanted to say when he is running that created exe file thats running well but its also opening the source code of that exe file.
he just want to keep that exe file in seprate folder and when he or someone else click on that exe file only that exe file get executed.

Re: create a program exe file in C. 80 80

>>but its also opening the source code of that exe file
The OP is most likely wrong about that. *.exe programs don't need the source code for its own program. When I compile Hello.cpp to create Hello.exe the *.exe file doesn't need Hello.cpp. It might need some other shared libraries or DLLs, but that's a different problem.

Re: create a program exe file in C. 80 80

ohh, i catch it wrong..

Re: create a program exe file in C. 80 80

now i wan the exe to be secured that is no body can cm to know that it is a c compiler file. only the source can cm to know that it is file assosciated with itself.rt nw it is creating a exe file on which double click produces the required output. i wan only the producer of that exe file can run it. else nobody can cm to about it.

I think the best way from preventing someone from using your .exe file without actually hiding the file is by compressing into a zipt file and locking (encrypting) it with a password.

next time you can extract your .exe file using this password......

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.