Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- int main() {
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
- ZeroMemory(&pi, sizeof(pi));
- // Start the child process.
- if (!CreateProcess("C:\\Windows\\System32\\bcdedit.exe", "C:\\Windows\\System32\\bcdedit.exe /enum", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
- {
- if (!CreateProcess("C:\\Windows\\Sysnative\\bcdedit.exe", "C:\\Windows\\Sysnative\\bcdedit.exe /enum", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
- {
- puts("Error: CreateProcess Failed!");
- }
- }
- // Wait until child process exits.
- WaitForSingleObject(pi.hProcess, INFINITE);
- // Close process and thread handles.
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- printf("Press Enter To Continue ... ");
- (void)getchar();
- return 0;
- }
Add Comment
Please, Sign In to add comment