createprocess

CreateProcess to run as administrator

无人久伴 提交于 2019-12-19 10:28:20
问题 In my Win32 application I have the ability to run child processes with redirected input and output to anonymous pipes that I create and manage - this all works with the CreateProcess() function. However on Win7 (and presumably Vista) if that process is required to be run as administrator then this fails. So what I am looking for is a way to do the equivalent of the "run as administrator" command in explorer that will bring up the standard UAC prompt and then create the process with the

Communicate With Command Prompt Through Delphi

一世执手 提交于 2019-12-18 17:16:13
问题 I have tried to use delphi to send commands to the command prompt. However, i am not able to do so as i used CreateProcess method to do it. I have tried to change the StdOutPipeWrite, however, the CreateProcess seems to not allow commands after the initial command from CreateProcess to be passed through. Is there any way to make use of the handle to continue to send and receive commands and messages to and fro the command prompt and delphi? 回答1: My fellow member Glenn9999 from tek-tips.com

CreateProcess() Error

不羁的心 提交于 2019-12-18 07:18:12
问题 STARTUPINFO si; PROCESS_INFORMATION pi; memset(&si, 0, sizeof(si)); memset(&pi, 0, sizeof(pi)); si.cb = sizeof(si); LPCWSTR procName =(LPCWSTR)"D:\\test dir 1\\Calc.exe"; LPWSTR procArg =(LPWSTR)"blacknull"; if(CreateProcess(procName,procArg,0,0,0,CREATE_DEFAULT_ERROR_MODE,0,0,&si,&pi)) { //do some work } printf( "CreateProcess failed (%d).\n", GetLastError()); system("Pause"); It keeps throwing Error(2)-> The System cannot find the file specified . I don't know what's wrong. I also tried to

Linux CreateProcess?

余生长醉 提交于 2019-12-17 20:06:40
问题 I develop 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 invoker application closes (Just like CreateProcess Windows API). Is it possible in Linux or not? something like this function: void Linux_CreateProcess(const char* app_name) { // Executing app_name. // ???????? what is the code ?????? // app_name is

security issue with CreateProcess API

a 夏天 提交于 2019-12-13 14:26:23
问题 Objective : I am trying to send some files from my client to server. I am using "rsync" for transferring the data. I am using CreateProcess APi and passing the rsync path along with the parameters. Positive Case : When i send data from local drives like "C:" is where my windows is installed the above method works properly and transfers data. Problem : When i try to send data of a mapped drive (shared network drive) . The CreateProcess completes but the error which i get is rsync cannot find

Delphi - Gracefully Closing Created Process in Service. (using tprocess / createProcess)

你离开我真会死。 提交于 2019-12-13 12:42:52
问题 I have a Windows Service written in Delphi which runs a number of programs. On Stopping the service, I want to also close these programs. When the service was originally written, this worked fine, but I think I've updated the tProcess component and now - The subordinate programs are not being closed. in tProcess - Here's the code which starts the new processes. if CreateProcess( nil , PChar( FProcess.Command ) , nil , nil , False , NORMAL_PRIORITY_CLASS , nil , Directory , StartupInfo ,

Use CreateProcess to execute ADB command

核能气质少年 提交于 2019-12-13 08:18:23
问题 I want to use CreateProcess() to execute an ADB command that launches an application/activity. It works using the simpler system(command) function, but I want to eliminate the creation of the command line window by system(). Below is what I have right now. I have tried using different CreateProcess()es, like CreateProcessW and CreateProcessA, but to no avail. char prog[] = "C:\\Program Files\\Android\\sdk\\platform-tools\\platform-tools\\adb.exe"; char args[] = "adb shell am start -a android

how to make CreateProcess open new process in focus and not in background [duplicate]

若如初见. 提交于 2019-12-13 05:03:47
问题 This question already has answers here : How to bring window on top of the process created through CreateProcess (2 answers) Closed 5 years ago . I created a very simple Win program. it opens notepad and after 5 seconds it opens calc. the problem is that always the first program opens in background and not in focus (see the picture). the second program opens in focus. i've been wondering about this for a while and i can't figure out why it happens or how to open the first program in focus. I

run batch file with /y using createprocess vs2010

空扰寡人 提交于 2019-12-13 04:24:20
问题 my batch file asking for input y/n. i run that batch file using CreateProcess() method. If i run my batch file with /y as commnad line, it not ask for input. e.g run.bat /y i want to run my batch file using CreateProcess() with command line /y,as above e.g, i don't know how to do this using CreateProcess() an i don't want to modify my batch file. ::CreateProcess(L"run.bat",NULL,NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&startInfo,&procInfo ) , i also try this ::CreateProcess(L"run.bat",L"/y

Gcc.exe: CreateProcess : No such File or directory - Error?

人盡茶涼 提交于 2019-12-13 00:55:00
问题 I am writing an Objective C program and i saved it as 'hello.m'. The problem is when i am trying to compile it usig MinGW it is giving an error gcc hello.m // i used for compiling and it is giving following error gcc.exe: CreateProcess : No such File or directory is there any way to fix ..so that i can move forward.. Thank You 回答1: Use Sysinternals ProcessMonitor from here. What you do is find the .exe name that is doing the compiling under the Process Name column, like gcc.exe . Then look in