Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Svyatik-Bak authored Nov 5, 2022
1 parent 9a27e16 commit f35a6e8
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
#include <stdio.h>
#include <windows.h>

wchar_t wd[255], program[255], args[255];

int wmain(int argc, wchar_t *argv[], wchar_t *argv2[])
int wmain(int argc, wchar_t **argv, wchar_t **argv2)
{
if (argc > 1)
{
ShellExecuteW(NULL, L"runas", argv[1], argv[2], NULL, SW_RESTORE);
ShellExecuteW(NULL, L"runas", argv[1], argv[2], NULL, SW_SHOW);
}
if (argc < 2)
else
{
system("title SimpleRunBox");
system("title SimpleRunBox"); wchar_t wd[255], program[255], args[255];
wprintf(L"Enter path to the program\n");
_getws(program);
system("cls");
wprintf(L"Enter what do (for example: open, runas)\n");
wprintf(L"Enter operation (default is open)\n");
_getws(wd);
system("cls");
wprintf(L"Enter arguments\n");
_getws(args);
system("cls");
wprintf(L"Summary:\n");
wprintf(L"Program: %ls\n", program);
wprintf(L"What do with the program: %ls\n", wd);
wprintf(L"Arguments: %ls\n", args);
system("pause");
ShellExecuteW(NULL, wd, program, args, NULL, SW_RESTORE);
wprintf(L"Summary:\nProgram: %ls\nWhat do with the program: %ls\nArguments: %ls\n", program, wd, args);
wprintf(L"\nPress any key if everything seems right"); getchar();
ShellExecuteW(NULL, wd, program, args, NULL, SW_SHOW);
return 0;
}
}

0 comments on commit f35a6e8

Please sign in to comment.