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.

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

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.

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

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.

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.

Edited 6 Years Ago by Ancient Dragon: n/a

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.

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.

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

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?

Edited 6 Years Ago by Kamatari: n/a

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.

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.

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.

" 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.

>>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.

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......

This question has already been answered. Start a new discussion instead.