This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a27e16
commit f35a6e8
Showing
1 changed file
with
9 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |