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

Commit

Permalink
Updated main.c
Browse files Browse the repository at this point in the history
Fixed bugs, added cmd arguments
  • Loading branch information
Svyatik-Bak authored Oct 26, 2022
1 parent 2560451 commit da35b22
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#include <stdio.h>
#include <locale.h>
#include <windows.h>

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


int wmain()
int wmain(int argc, wchar_t *argv[], wchar_t *argv2[])
{
if (argc > 1)
{
ShellExecuteW(NULL, L"runas", argv[1], argv[2], NULL, SW_RESTORE);
}
if (argc < 2)
{
system("title SimpleRunBox");
wprintf(L"Enter path to the program\n");
_getws(program);
Expand All @@ -23,4 +27,5 @@ int wmain()
wprintf(L"Arguments: %ls\n", args);
system("pause");
ShellExecuteW(NULL, wd, program, args, NULL, SW_RESTORE);
}
}

0 comments on commit da35b22

Please sign in to comment.