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
-1
votes
1 answer

Execute a process or Create a process and set time interval to closed it

I would like to execute an application with parameters without a gui window, then auto end process gracefully in 2minutes. This is how I use the code: procedure ExecNoWait(Filename: string); var bchExec: array[0..1024] of char; pchEXEC:…
XenKid
  • 161
  • 3
  • 16
-1
votes
1 answer

CreateProcess with a custom string

I'm trying to run 'CreateProcess' in c, with a custom string that I build. When I'm using a simple string like: TCHAR command[]= _T("MyApp.exe -OPTION1 -OPTION2") Everything seems to work fine. But as I try to build a custom string (with getting…
Isaac
  • 29
  • 6
-1
votes
2 answers

CreateProcess failed in C

i'm trying to create a process using the following code: void GenerateCommandLine( char *commandLine, int maxLength, const char *imageTitle) { const char * COMMAND_LINE_TEMPLATE =…
-2
votes
2 answers

fopen opens File before calling it

First my code: void RecvPaths(char *szRETURN) { FILE *hFILE; char *szFILE = new char[2048]; hFILE = fopen("FLM.tmp", "r"); do { fgets(szFILE, 2048, hFILE); strcat(szRETURN, szFILE); } while(!feof(hFILE)); …
Shadowigor
  • 21
  • 4
-2
votes
1 answer

Launch an .exe file from Win32

I have been trying to start an exe file from a Win32 application, however I have been unable to get it to work. I want to pass an argument to it as well, but I don't think I am doing it correctly. A similar question has been asked here before, but…
theratcoder
  • 23
  • 12
-2
votes
2 answers

How to check Win32 CreateProcess() failed reason using ProcMon. exclude GetLastError()

I am having an issue with checking CreateProcess() failure reason, there was a code in production which doesn't log GetLastError() when CreateProcess() failed so i am running ProcMon to check the reason but unable to find the reason (Will procMon…
NDestiny
  • 1,133
  • 1
  • 12
  • 28
-2
votes
1 answer

How can I CreateProcess with DPI awareness set to DPI_AWARENESS_CONTEXT_UNAWARE

I have C++ application which opens other apps with CreateProcessA on Windows 10. These apps could have different settings for DPI Awareness. So the question is - can I create processes with DPI Awareness set to DPI_AWARENESS_CONTEXT_UNAWARE? If not…
htonus
  • 629
  • 1
  • 9
  • 19
-2
votes
2 answers

Why does another executable file doesn't give me a hint just like the other one on how parameters in command-line should be formatted?

In one of my executable file when I try to call it using CreateProcess and passed some parameters in command line the executable file gives me a hint that the parameter should be like this format. But, when I try to call another executable it…
-2
votes
1 answer

windows Runas always returns "The System cannot find the file specified"

Windows runas.exe application does not work when I use the same syntax shown in runas /?. For example one of the usages shown is, runas /trustlevel program, however, when I use runas /trustlevel<0x20000> calc I get "The system cannot…
-2
votes
2 answers

Unable to pass command line to new exe created by CreateProcess

I am now trying to call an .exe from my application written in C++ The exe that I am trying to call is a Kermit program (k95.exe) - a file transfer app. Without using C++, I am able type in command at the Kermit program and it works. However, now I…
Vinc
  • 25
  • 1
  • 4
-2
votes
2 answers

obtain user input from CreateProcess with CREATE_NEW_CONSOLE

I do this: if (!CreateProcessA(NULL, lArgs, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &StartupInfo, &ProcessInfo)) { free(lArgs); return GetLastError(); } But I don't know how to obtain the input from the console. Am I oblige…
user6795571
  • 139
  • 1
  • 7
-2
votes
1 answer

why does cmd.exe in CreateProcess behaves different from DOS-prompt?

I use Altar's GetDOSOutput() (variant 1) to this question to call dos-commands by a simple delphi program. However, existing DOS program's such as DiskPart cannot be found when called by by CreateProcess whereas they present no problem when called…
user508402
  • 496
  • 1
  • 4
  • 19
-2
votes
1 answer

Program recognizes a copy of itself in the operating system

I'm trying to create a piece of software that will not be susceptible to bots. Is there a way for me to code into a program a way to check in the operating system for a process just like it and then put in a shutdown mechanism if it is recognized.…
-3
votes
1 answer

c++ can't pass an argument with CreateProcess

i have to pass a string into my process, but for some reason i can't i've tried to pass a path and an argument in function, i've tried to put a \0 after the argument, i've tried to pass an argument or space + an argument but it doesn't passes. could…
-3
votes
1 answer

Why isn't this code executing a hello world executable

Why isn't this code running my hello world c executable #include #include int main() { // path for hello world compiled program std::string app_path = "C:\\Users\\test\\Desktop\\a.exe"; BOOL inherit_handles =…
loaded_dypper
  • 262
  • 3
  • 12
1 2 3
40
41