Page 1 of 1

[Suggestion] Run as Administrator

Posted: May 15th, 2018, 1:09 pm
by oZone
Hi,
it is possible to add option to force program to run as administrator

Code: Select all

LeftMouseUpAction=[!RunasAdmin "path to program" "additional parameters"] 

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 1:09 pm
by jsmorley
It is not. You would need to set that attribute on the Rainmeter.exe executable.

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 1:32 pm
by oZone
I am not proficient in c++
but couldn't you use this

Code: Select all

SHELLEXECUTEINFO sh;

sh.lpVerb = _T("runas");
sh.lpFile = _T("path to program")
sh.lpParameters = "additional parameters";

ShellExecuteEx(&sh);
to elevate children process

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 2:23 pm
by jsmorley
oZone wrote:I am not proficient in c++
but couldn't you use this

Code: Select all

SHELLEXECUTEINFO sh;

sh.lpVerb = _T("runas");
sh.lpFile = _T("path to program")
sh.lpParameters = "additional parameters";

ShellExecuteEx(&sh);
to elevate children process
We are just never going to encourage "authors" to distribute skins that can elevate themselves to administrator, even with a User Account Control prompt from the OS, which any given user may have turned off. This is entirely up to the skin "user", who must specifically set the attribute on Rainmeter.exe. If any skin EVER prompted me for Administrator access to my system, I would say "no", unload it and delete it immediately. I wouldn't even look at the code, because I don't care, it has stepped way over the line.

If you want this for yourself, by all means, set "Run as administrator" on Rainmeter.exe and go nuts.

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 4:54 pm
by oZone
I only asked, you don't have to be angry.

Running rainmeter as administrator is not option, as I want to run program as administrator only when I need.

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 5:26 pm
by jsmorley
oZone wrote:I only asked, you don't have to be angry.

Running rainmeter as administrator is not option, as I want to run program as administrator only when I need.
;-) I'm certainly not angry about it... Just wanted to be clear and firm about where we stand.

Re: [Suggestion] Run as Administrator

Posted: May 15th, 2018, 5:38 pm
by oZone
Now that I think about it, it makes sense to not add this feature.

And I found a workaround using powershell so I don't need it anymore.