It is currently March 28th, 2024, 11:30 am

[Suggestion] Run as Administrator

Report bugs with the Rainmeter application and suggest features.
Post Reply
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

[Suggestion] Run as Administrator

Post 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"] 
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Run as Administrator

Post by jsmorley »

It is not. You would need to set that attribute on the Rainmeter.exe executable.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestion] Run as Administrator

Post 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
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Run as Administrator

Post 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.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestion] Run as Administrator

Post 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.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Run as Administrator

Post 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.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestion] Run as Administrator

Post 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.
Post Reply