Hi there,
I have problems with CreateProcess. I cannot realize even a simple DOS-command.
Can you tell me what is wrong in this source code?
/**************************/
STARTUPINFO si;
PROCESS_INFORMATION pi;
si.cb = sizeof(si);
char cmd[] = "rename D:\\Documents\\myFile.txt output.txt";
if(! CreateProcess( NULL ,cmd, NULL , NULL , FALSE , 0 , NULL , NULL , &si , &pi ))
m_sOutput = "Success";
else
m_sOutput = "Error";
UpdateData(false);
/**************************/
As you can see I am using MFC here. In this example the function CreateProcess returns no error but it has no effect!
Thanks in advance!
I have problems with CreateProcess. I cannot realize even a simple DOS-command.
Can you tell me what is wrong in this source code?
/**************************/
STARTUPINFO si;
PROCESS_INFORMATION pi;
si.cb = sizeof(si);
char cmd[] = "rename D:\\Documents\\myFile.txt output.txt";
if(! CreateProcess( NULL ,cmd, NULL , NULL , FALSE , 0 , NULL , NULL , &si , &pi ))
m_sOutput = "Success";
else
m_sOutput = "Error";
UpdateData(false);
/**************************/
As you can see I am using MFC here. In this example the function CreateProcess returns no error but it has no effect!
Thanks in advance!