It is currently September 8th, 2024, 12:02 am

Get BIOS Release Date and format

Get help with creating, editing & fixing problems with skins
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Get BIOS Release Date and format

Post by Sh8dyDan »

I've found some places where I can get BIOS Release Date, but I'm not sure how to pull it. Not sure of commands or if it is possible.

Msinfo.exe
Msinfo32.png
HWiNFO
HWiNFO.png
C:\Users\Dan>wmic bios get ReleaseDate
ReleaseDate
20240327000000.000000+000

I am terrible with RegEx by the way.

I am trying to have an output like
2024/03/27

Any help or wisdom is much appreciated.
You do not have the required permissions to view the files attached to this post.
Last edited by Sh8dyDan on July 20th, 2024, 9:55 pm, edited 2 times in total.
User avatar
KazukiGames82
Posts: 31
Joined: January 25th, 2023, 2:56 am

Re: Get BIOS Release Date and format

Post by KazukiGames82 »

Sh8dyDan wrote: July 19th, 2024, 6:21 pm I am trying to have an output like
2024/03/27
This measure can get the bios version

Code: Select all

[MeasureBIOSVersion]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SYSTEM\HardwareConfig\Current
RegValue=BIOSReleaseDate
UpdateDivider=-1
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get BIOS Release Date and format

Post by balala »

You can try adding the following measure to your code (I assume you have a code, right?):

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic bios get ReleaseDate
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute=".*\n(\d{4})(\d{2})(\d{2}).*\n.*":"\1.\2.\3"
When ran, this measure returns the needed date, using this method:
Sh8dyDan wrote: July 19th, 2024, 6:21 pm C:\Users\Dan>wmic bios get ReleaseDate
ReleaseDate
20240327000000.000000+000
Note that in order to get the above measure executed, you have to run it, which can be done by a proper !CommandMeasure bang. Add such a bang for instance to the OnRefreshAction option of the [Rainmeter] section: OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"]. By this you get the measure executed right after refreshing / loading the skin. It takes a few seconds to get it executed, but make sure you're allowing the skin to increase its size, to can show up the result. You can do this by adding a DynamicWindowSize=1 option to the same [Rainmeter] section.
Please let us know if you couldn't get this working.
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Re: Get BIOS Release Date and format

Post by Sh8dyDan »

Thank you very much.
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Re: Get BIOS Release Date and format

Post by Sh8dyDan »

To both of you
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Get BIOS Release Date and format

Post by balala »

Sh8dyDan wrote: July 19th, 2024, 6:57 pm Thank you very much.
Sh8dyDan wrote: July 19th, 2024, 7:03 pm To both of you
Did you get it working? Any of the posted two methods?
User avatar
Brian
Developer
Posts: 2725
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [SOLVED] Get BIOS Release Date and format [SOLVED]

Post by Brian »

I just want to remind everyone that the wmic command is now deprecated by Windows, and may not be installed by default on Windows.

I believe it will be available as a "feature on demand" for the time being, meaning you may have to manually install it.

https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features

-Brian

PS - That link provides a list of other deprecated items like WordPad, VBScript, etc.
User avatar
ikarus1969
Posts: 588
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [SOLVED] Get BIOS Release Date and format [SOLVED]

Post by ikarus1969 »

So, the üpwershell replace ment for the wmic-command would be:

Code: Select all

Get-CimInstance -ClassName Win32_BIOS | Select-Object -Property ReleaseDate
The format is slightly different, but that should not be a big problem:
Screenshot RM.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [SOLVED] Get BIOS Release Date and format [SOLVED]

Post by balala »

Brian wrote: July 19th, 2024, 9:28 pm I just want to remind everyone that the wmic command is now deprecated by Windows, and may not be installed by default on Windows.
Alright, on my side wmic is still working, but if this is the case, there might be computers on which it doesn't work (I assume). According to ikarus1969's post:
ikarus1969 wrote: July 20th, 2024, 7:15 am So, the üpwershell replace ment for the wmic-command would be:

Code: Select all

Get-CimInstance -ClassName Win32_BIOS | Select-Object -Property ReleaseDate
to avoid the issue, the [MeasureRun] measure should be rewritten this way, for instance:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=Get-CimInstance -ClassName Win32_BIOS | Select-Object -Property ReleaseDate
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"",".*(\d{4})-(\d{2})-(\d{2}).*":"\1.\2.\3"
Everything applies as described previously (the measure has to be executed by the same !CommandMeasure bang, as posted before).
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Re: Get BIOS Release Date and format

Post by Sh8dyDan »

balala wrote: July 19th, 2024, 7:39 pm Did you get it working? Any of the posted two methods?
I did get it working, thank you.

----------

Thanks to Brian for pointing out that the wmic command is now deprecated by Windows. Also thank to ikarus1969 for new command using CimInstance in PowerShell.


I'm afraid I'm going to have to ask for help from you guys with some RegEx.
I'm trying but struggling with RegEx. Is RegEx101.com an option and if so what settings would select to generate an output for Rainmeter

OUTPUT STRING:

Code: Select all


ReleaseDate         
-----------         
3/26/2024 8:00:00 PM


RESULT:

Code: Select all

2024/03/26
OUTPUT STRING:

Code: Select all


Caption                 
-------                 
Microsoft Windows 11 Pro


RESULT:

Code: Select all

Microsoft Windows 11 Pro