Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

call default windows executables in C program

Tags:

c

windows

winapi

I used system() function to call certmgr.exe in my C code. Once I start my executable, a command promt appears showing certificate successfully installed.

But I dont want the command promt to be opened. How to do that??

any other ways available to call the "exe's" in C language..

thanks,,,

like image 291
2vision2 Avatar asked May 21 '12 10:05

2vision2


People also ask

How do I call an executable program in Windows PowerShell?

When calling an executable program in Windows PowerShell, place the stop-parsing symbol before the program arguments. After the stop-parsing symbol --% , the arguments up to the end of the line (or pipe, if you are piping) are passed as is.

How do I open a C program in Windows 10?

While in the command prompt type "cd", then enter. From there type "cdprogram" then hit the tab button until you see "c:[&program&] files (x86)", then hit enter. Sorry to say so but your first command is superfluous and the second command will not work. The correct command would be (note the space!):

How to continue the execution of a C program after calling it?

If you want to continue the execution of C prgram even after calling the executable from the C program, then try to use system() function call. You can create a string with executable name and the arguments printed to the string using sprintf(). Then pass the string as argument to system() call.

How do I compile C program and create an executable file?

H ow do I compile C program and create an executable file under Linux or UNIX operating systems? You need GNU project C and C++ compiler for compiling C program and creating an executable file. Most Unix and Linux (*BSD) user start compiling their C program by the name cc. [donotprint] [/donotprint]But you can use gcc command to compile program.


1 Answers

The easiest way to do this on Windows is to call ShellExecute. Pass SW_HIDE to make sure that no console window is shown.

You could alternatively use CreateProcess but it's a little trickier to call. Use the CREATE_NO_WINDOW flag to suppress the console window.

like image 72
David Heffernan Avatar answered Oct 15 '22 04:10

David Heffernan