Questions tagged [createprocess]

Refers to programmatically running an application from another.

In the Windows API the function CreateProcess is used to create a new process.

See for similar functionality on UNIX/POSIX systems.

609 questions
35
votes
3 answers

How can I run a child process that requires elevation and wait?

Win 7/UAC is driving me crazy. From within my C++ application, I need to run an executable that requires elevation on Windows 7. I want to fire this thing off and wait for it to finish before proceeding. What's the easiest way to do this? I…
KenG
  • 353
  • 1
  • 3
  • 4
34
votes
8 answers

CreateProcess doesn't pass command line arguments

Hello I have the following code but it isn't working as expected, can't figure out what the problem is. Basically, I'm executing a process (a .NET process) and passing it command line arguments, it is executed successfully by CreateProcess() but…
akif
  • 12,034
  • 24
  • 73
  • 85
33
votes
3 answers

Ndk-build: CreateProcess: make (e=87): The parameter is incorrect

I get an error when build static lib with NDK on Windows platform: process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed. make…
Oleksandr Shtykhno
  • 766
  • 2
  • 7
  • 12
26
votes
2 answers

How to increase the maximum number of child processes that can be spawned by a windows service -- desktop heap limits

Q: I have a windows service that spawns a lot of child processes. There seems to be some limit, around 100, where the process cannot be launched. The CreateProcess() call comes back with a pid, but then the process just fails to materialize. If I…
Wheezil
  • 3,157
  • 1
  • 23
  • 36
26
votes
1 answer

How to run application which requires admin rights from one that doesn't have them

I've been stuck on this for a few hours until I've finally managed to do it. There are already links which pointed me the right direction: Is it possible for the executable to ask for Administrator rights? (Windows 7) CreateProcess error=740, The…
Samuel
  • 2,430
  • 5
  • 31
  • 41
24
votes
4 answers

how to terminate a process created by CreateProcess()?

I have created a process using CreateProcess(). This is the code: STARTUPINFO si = {0}; PROCESS_INFORMATION pi = {0}; result = CreateProcess("C:\\AP\\DatabaseBase\\dbntsrv.exe", NULL, NULL, NULL, FALSE, 0, NULL, "C:\\ADP\\SQLBase", &si, &pi) How…
digvijay
  • 361
  • 2
  • 4
  • 12
24
votes
5 answers

Is it possible to execute a .NET dll without an exe to load it?

I'm curious if there's a way to execute a static .DLL method in a new process without having to create an .EXE for it? AFAIK, this isn't possible with native Win32/64 DLLs. How about .NET DLL assemblies? UPDATE: I forgot to mention I'm primarily…
aoven
  • 2,248
  • 2
  • 25
  • 36
20
votes
2 answers

AssignProcessToJobObject fails with "Access Denied" error when running under the debugger

You do AssignProcessToJobObject and it fails with "access denied" but only when you are running in the debugger. Why is this?
1800 INFORMATION
  • 131,367
  • 29
  • 160
  • 239
19
votes
6 answers

Android Studio 3.1.1 CreateProcess error=206, The filename or extension is too long

I am getting the below exception when building the app from Android Studio It says CreateProcess error=206, The filename or extension is too long at I had tried enabling longer paths in Windows regedit, but still facing the issue. Please…
user2067340
  • 231
  • 1
  • 2
  • 8
18
votes
1 answer

Win32 CreateProcess: When is CREATE_UNICODE_ENVIRONMENT *really* needed?

The CreateProcess documentation states (my bold emphasis): lpEnvironment [in, optional] [...] If the environment block pointed to by lpEnvironment contains Unicode characters, be sure that dwCreationFlags includes CREATE_UNICODE_ENVIRONMENT. If…
Leo Davidson
  • 6,093
  • 1
  • 27
  • 29
18
votes
3 answers

CreateProcess() fails with an access violation

My aim is to execute an external executable in my program. First, I used system() function, but I don't want the console to be seen to the user. So, I searched a bit, and found CreateProcess() function. However, when I try to pass a parameter to it,…
John Doe
  • 633
  • 3
  • 14
  • 24
17
votes
1 answer

Access Violation in function CreateProcess in Delphi 2009

In my program I've the following code: //Code if not CreateProcess(nil, NonConstCmd, nil, nil, True, NORMAL_PRIORITY_CLASS or CREATE_NEW_PROCESS_GROUP, nil, PCh, SI, P) then //Code And I keep getting Access violation error. By the way, in…
vralex
  • 251
  • 3
  • 7
14
votes
8 answers

Linux CreateProcess?

I developing on the Linux platform. I want to create a new proccess in my library without replacing the current executing image. Because I am developing a library, I don't have a main function. And I want to continue the new process after the…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
14
votes
2 answers

Get the PID of the process started by CreateProcess()

Let me start off by stating that I'm not from C background. I'm a PHP developer. So everything that I've coded so far is by taking bits and pieces from other examples and fine tuning them to meet my requirements. So please bear with me if I ask way…
asprin
  • 9,579
  • 12
  • 66
  • 119
12
votes
3 answers

Why does Unix have fork() but not CreateProcess()?

I do not get why Unix has fork() for creating a new process. In Win32 API we have CreateProcess() which creates a new process and loads an executable into its address space, then starts executing from the entry point. However Unix offers fork for…
Hayri Uğur Koltuk
  • 2,970
  • 4
  • 31
  • 60
1
2 3
40 41