- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
#include "stdafx.h"
#include "windows.h"
#include <iostream>
int main()
{
STARTUPINFOA si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
ZeroMemory( &pi, sizeof(pi) );
SECURITY_ATTRIBUTES secat;
secat.nLength = sizeof(SECURITY_ATTRIBUTES);
secat.bInheritHandle = TRUE;
HANDLE newin, writein;
CreatePipe(&newin,&writein,&secat,0);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNORMAL;
si.hStdInput=newin;
GetStartupInfoA(&si);
si.cb;
CreateProcessA(NULL, "cmd.exe", NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
DWORD bytes;
char command[100] = "mkdir 1254655553";
WriteFile(writein, command, 100, &bytes, NULL);
std::cin.get();
}
Создание директории.
p.s. ачат и иже с ним.