It is currently April 28th, 2024, 5:58 am

How to execute the "Reboot to UEFI Bios" command with Rainmeter

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Yincognito »

Youkai1977 wrote: November 16th, 2023, 8:19 am @Yincognito


Ah ok. So now I understand that to mean the part from 'ZXCVBOT':

Code: Select all

[mRebootToUEFI]
Measure=PLUGIN
Plugin=RunCommand
Program=PowerShell
Parameter=(shutdown /r /fw /t 0)
through your part:

Code: Select all

[MS_RunCommand_KillProcess]
Measure=Plugin
Plugin=RunCommand
Program=powershell
Parameter=Start-Process taskkill -windowstyle Hidden -verb RunAs '/F /FI \"IMAGENAME eq #ProcessToKill#.*\"'
State=Hide
OutputType=ANSI
Timeout=5000
DynamicVariables=1
should replace this, right?

However, I don't know what to do with the part

Code: Select all

#ProcessToKill#
now. This is a variable that refers to something, or am I making a mistake here? If so, then sorry :???: :oops:
Yeah, in fact you can use ZXCVBOT's measure, but you will have to integrate your shutdown command and parameters into PowerShell's Start-Process command, so that you can run the former as an administrator and in a hidden window:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.3
Check out the 2nd syntax and the 5th example there. For the nth time, the parts related to killing a process from my example (including that variable) are completely irrelevant since you should replace them with your shutdown routine. Basically you should apply that PowerShell command to your plain shutdown one.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Youkai1977 »

Yeah, in fact you can use ZXCVBOT's measure, but you will have to integrate your shutdown command and parameters into PowerShell's Start-Process command, so that you can run the former as an administrator and in a hidden window:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.3
Check out the 2nd syntax and the 5th example there. For the nth time, the parts related to killing a process from my example (including that variable) are completely irrelevant since you should replace them with your shutdown routine. Basically you should apply that PowerShell command to your plain shutdown one.
Ok, so up to the point where you write that I can put your code in the place of ZXCVBOT's Measure I understood it. Then came the link to Microsoft and I got the feeling that I had to understand the Einstein formula "E=mc²" backwards in Latin. :???: :confused:
In short, that's nice of you with the link, I've saved it too. But at the moment I'm happy if I manage to understand my son's 5th grade math homework.

However, I have at least understood the rest of your answer, and now have it as follows:

Code: Select all

[mRebootToUEFI]
Measure=PLUGIN
Plugin=RunCommand
Program=powershell
Parameter=Start-Process taskkill -windowstyle Hidden -verb RunAs '/r /fw /t 0'
State=Hide
OutputType=ANSI
Timeout=5000
DynamicVariables=1

If I now double-click on the corresponding button in my skin/meter, I get the question from the UAC of my Windows whether I want to allow "Finished processes" to be executed. If I click yes here, NOTHING happens afterwards.

I assume this is because I didn't understand the issue and the code is wrong, right?
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Yincognito »

Youkai1977 wrote: November 16th, 2023, 11:35 am Ok, so up to the point where you write that I can put your code in the place of ZXCVBOT's Measure I understood it. Then came the link to Microsoft and I got the feeling that I had to understand the Einstein formula "E=mc²" backwards in Latin. :???: :confused:
In short, that's nice of you with the link, I've saved it too. But at the moment I'm happy if I manage to understand my son's 5th grade math homework.

However, I have at least understood the rest of your answer, and now have it as follows:

Code: Select all

[mRebootToUEFI]
Measure=PLUGIN
Plugin=RunCommand
Program=powershell
Parameter=Start-Process taskkill -windowstyle Hidden -verb RunAs '/r /fw /t 0'
State=Hide
OutputType=ANSI
Timeout=5000
DynamicVariables=1

If I now double-click on the corresponding button in my skin/meter, I get the question from the UAC of my Windows whether I want to allow "Finished processes" to be executed. If I click yes here, NOTHING happens afterwards.

I assume this is because I didn't understand the issue and the code is wrong, right?
Your code is actually correct, you did well replacing the earlier taskkill.exe parameters with the ones corresponding to shutdown.exe... but you didn't replace the process itself, that's why nothing happens. So, just replace taskkill with the full path to your shutdown.exe, it's that simple. You don't need math or knowing the syntax of things, it's a matter of replacing A with B (which you didn't) and C with D (which you did), really... :confused:

P.S. By the way, I can't guarantee you won't get an UAC prompt after you click to run this thing, I can only guarantee that it will work once you permit stuff in that prompt. On my system, where UAC is entirely disabled, it worked right away, as after restart I got my Bios / Uefi related options.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Youkai1977 »

@Yincognito

You were right. I have now changed it as follows:

Code: Select all

[mRebootToUEFI]
Measure=PLUGIN
Plugin=RunCommand
Program=powershell
Parameter=Start-Process C:\Windows\System32\shutdown.exe -windowstyle Hidden -verb RunAs '/r /fw /t 0'
State=Hide
OutputType=ANSI
Timeout=5000
DynamicVariables=1
And as you also described, it works immediately.

However, I get the UAC, which I have to confirm with "YES".
But that shouldn't be wrong, as my son also uses my PC from time to time (sometimes with his friends) to play games.
And since the "Restart to UEFI" is freely accessible, you can see if you download and install my skin/meter a few posts back, the boys will be startled if they press the button and then the UAC pops up. :o O.O

In this sense, thank you very much again for your patience with me and all the tips. :bow: :oops:
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Yincognito »

Youkai1977 wrote: November 17th, 2023, 8:11 am @Yincognito

You were right. I have now changed it as follows:

Code: Select all

[mRebootToUEFI]
Measure=PLUGIN
Plugin=RunCommand
Program=powershell
Parameter=Start-Process C:\Windows\System32\shutdown.exe -windowstyle Hidden -verb RunAs '/r /fw /t 0'
State=Hide
OutputType=ANSI
Timeout=5000
DynamicVariables=1
And as you also described, it works immediately.

However, I get the UAC, which I have to confirm with "YES".
But that shouldn't be wrong, as my son also uses my PC from time to time (sometimes with his friends) to play games.
And since the "Restart to UEFI" is freely accessible, you can see if you download and install my skin/meter a few posts back, the boys will be startled if they press the button and then the UAC pops up. :o O.O

In this sense, thank you very much again for your patience with me and all the tips. :bow: :oops:
No problem, I'm glad that a solution to this was finally reached. Nice to hear it is suited for your son and his friends too. :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Youkai1977 »

Yes, I'm glad it works now too. I'm less worried about unlocking the UAC as a parental control for my son, even though he's only 11. He is very careful and also quite smart when it comes to technology. He sent his mother a fax when he was 3 years old. :rofl:
However, I don't trust his friends that much when it comes to my PC. They are very clueless and click on anything that seems interesting. And since, as I mentioned in one of my posts, my PC runs with admin rights, things can go wrong very quickly. I always have fairly up-to-date backups to hand, but still ...

But well, thanks again for your patience and help. :bow:
I am already working on the next project, a skin/meter for my Rasperry PI running as PiHole. I'm sure there will be one thing where I might need help again :oops:
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Yincognito »

Youkai1977 wrote: November 19th, 2023, 12:53 pm Yes, I'm glad it works now too. I'm less worried about unlocking the UAC as a parental control for my son, even though he's only 11. He is very careful and also quite smart when it comes to technology. He sent his mother a fax when he was 3 years old. :rofl:
However, I don't trust his friends that much when it comes to my PC. They are very clueless and click on anything that seems interesting. And since, as I mentioned in one of my posts, my PC runs with admin rights, things can go wrong very quickly. I always have fairly up-to-date backups to hand, but still ...

But well, thanks again for your patience and help. :bow:
I am already working on the next project, a skin/meter for my Rasperry PI running as PiHole. I'm sure there will be one thing where I might need help again :oops:
Haha, yeah, that's one smart boy you have indeed - I was learning basic math and drinking vodka thinking it was water at 3, so it all looks well for your son. :lol:

Not much into Raspberry PI, PiHoles and such, but if it'll be about Rainmeter, then you'll probably get the help, if needed. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Youkai1977 »

Haha, yeah, that's one smart boy you have indeed - I was learning basic math and drinking vodka thinking it was water at 3, so it all looks well for your son. :lol:
Okay, that's crass about the vodka. :lol:
I remember with my son, when he was about 2.5 years old, we were in an ice cream parlor and I ordered an ice cream sundae that had eggnog in it. But I hadn't paid attention and let my son have a nibble.
Suddenly he became so quiet ... oops ... O.O :o
Not much into Raspberry PI, PiHoles and such, but if it'll be about Rainmeter, then you'll probably get the help, if needed. ;-)
I'm also just starting out with PiHole (Rasperry Pi). And without a few instructions from the Internet, I probably wouldn't be able to get it up and running.
But things are looking pretty good at the moment. I've had the PiHole running in my home network for 3 days and I'm shocked at how much advertising etc. it blocks. In the first hour alone over 850 entries. :o
I currently have 11,530 entries. That makes up 53.5% of the data connections of the 18 devices in my network.
The frontrunners are my Xiaomi Note 10 Pro rice stove and, how could it be otherwise, my PC with Windows 11 8-)
As far as my skin/meter is concerned, I found a skin/meter on the Internet which I simply adapted to my needs. Most of it in such a way that it visually matches the rest of my other skins/meters.

But all in all it is mainly a skin/meter that works with webparser. So, if I ever need help with this, I've noticed in the past that there are many experts here in the forum on the subject of webparsers, their syntax and especially this RegEx thing. Especially with the latter, I break off every time I need something for my purposes. Even the RegEx tool is only of limited help to me.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Yincognito »

Youkai1977 wrote: November 20th, 2023, 11:22 am Okay, that's crass about the vodka. :lol:
I remember with my son, when he was about 2.5 years old, we were in an ice cream parlor and I ordered an ice cream sundae that had eggnog in it. But I hadn't paid attention and let my son have a nibble.
Suddenly he became so quiet ... oops ... O.O :o

I'm also just starting out with PiHole (Rasperry Pi). And without a few instructions from the Internet, I probably wouldn't be able to get it up and running.
But things are looking pretty good at the moment. I've had the PiHole running in my home network for 3 days and I'm shocked at how much advertising etc. it blocks. In the first hour alone over 850 entries. :o
I currently have 11,530 entries. That makes up 53.5% of the data connections of the 18 devices in my network.
The frontrunners are my Xiaomi Note 10 Pro rice stove and, how could it be otherwise, my PC with Windows 11 8-)
As far as my skin/meter is concerned, I found a skin/meter on the Internet which I simply adapted to my needs. Most of it in such a way that it visually matches the rest of my other skins/meters.

But all in all it is mainly a skin/meter that works with webparser. So, if I ever need help with this, I've noticed in the past that there are many experts here in the forum on the subject of webparsers, their syntax and especially this RegEx thing. Especially with the latter, I break off every time I need something for my purposes. Even the RegEx tool is only of limited help to me.
Yep, that was basically what happened as well when I had the vodka (well, a local equivalent actually) incident. A couple of moments without parent supervision at a grown ups event and thinking it was water, then suddenly I turned out quiet, had no air to breathe and my face turned out red, haha. Apart from the momentary panic, it all turned out well, didn't turn me into an alcoholic later on, and it was a funny moment in retrospective. :D

Yeah, lots of ads and behind the user's back connections from all kinds of sources these days, to put it mildly. Even many tools supposed to protect you against that do it themselves in another form without any concern about being invasive and potentially dangerous. Generally, the lesser the brand name of various stuff, the lesser the trouble with these things.

WebParser and regex are quite simple at their basics, but those basics must be properly understood in order to take full advantage of such capabilities. For me, a site like RegExR.com is a great resource for both the fundamentals via the RegEx Reference menu from the sidebar on the left, as well as testing out things before implementing them in skins, once you pick up the regex flavor that Rainmeter is using (PCRE) from the top right button there. The interface is simple, uncluttered and compact, and most if not all my regex patterns (and there are quite a few, and complex) are created, tested and polished there before being transferred to my skins.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: How to execute the "Reboot to UEFI Bios" command with Rainmeter

Post by Youkai1977 »

Haha, yes, I can just imagine when you think it's water and then ... O.O :rofl:
Thank God my son didn't become an alcoholic either. Quite the opposite, if his dad dares to have even one beer. :x :thumbdown:

So the fact that there is a little more data traffic than just what you request as a user in the respective device/software was nothing new to me.
But what is really happening in terms of "calling home" in terms of data traffic and crude connections is frightening if you can only visualize it thanks to a PiHole.
That's why I'm glad to have one of these now. Even though I still have some fine-tuning to do in the near future as far as the block lists are concerned. Because in the rough default settings, depending on the blocklist used, really everything is blocked. Amazon didn't even work for me, Minecraft for my son, or even my mother's favorite online TV portal.
In short, you can't completely avoid some snooping and data octopus connections if you want to use certain things.
WebParser and regex are quite simple at their basics, but those basics must be properly understood in order to take full advantage of such capabilities
That's exactly my problem, understanding that.
Not that I'm generally too stupid. But with some RegEx things I really break off. And to make matters worse for me, there is almost only sensible information and learning material (especially in the IT sector) in English, which is not my native language. This makes it doubly difficult for me to understand one thing or another.
That's why I like to work with example code or ready-made skins/meters here at Rainmeter, for example, where I pick out what I think is what I need and experiment with it. So far I haven't come up with an atomic bomb activation key, only "it works" or "it doesn't work".
In the meantime, I'm quite capable of writing a skin/meter from my head, but when it comes to something more complicated, I either need you here or, as mentioned, an example code or skin/meter where I can take a look at the matter.
Looking back, when I needed help here, there were also a lot of times when I simply made a small mistake in the code.
The biggest problem for me is actually that I only use Rainmeter as a hobby. Too often I take long breaks when writing skins/meters. Just like with my last problem, where you and ZXCVBOT helped me. After a period like this, almost 2 years, a lot of things are simply gone and forgotten for me.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl: