user1978386
user1978386

Reputation: 257

How to create a new process in C++ code under Windows?

Can anybody answer me the question of how to create a new process from within C++ code with specific parameters for that process under windows ? e.g how to execute

"C:\Program Files (x86)\WinRAR\UnRAR.exe"

with some arguments ? or how to execute "reg import myRegEntry.reg" ?

I like explanations, but sometimes examples are better. I would be very thankfull for both

Thanks for anybody's help.

Upvotes: 0

Views: 4770

Answers (2)

QI3it
QI3it

Reputation: 181

Hope this helps: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

It is explained quite detailed.

Upvotes: 2

Ben Voigt
Ben Voigt

Reputation: 283624

CreateProcess and ShellExecute are both viable approaches.

Upvotes: 1

Related Questions