Solved

Function for BIOS Date

Posted on 2003-12-08
8
396 Views
Last Modified: 2010-05-01
Is there a function in visual basic that will return the BIOS/CMOS date?
0
Comment
Question by:eagle23
  • 5
  • 2
8 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9900905
There is a dos interrupt and a bios hardware interrupt.  Neither is accessible directly through VB.  You can do it in C.

You can write a fairly simple C.DLL with functions wrappers that can be called from VB.  What you need is Interrupt 1A, Function 03 to set the time, and function 05 to set the date.

for more information check this too.
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_10485918.html
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9900911
0
 
LVL 5

Expert Comment

by:mccainz2
ID: 9901007
As always Zarr's has an excellent answer.
http://www.zarr.net/vb/download/codedetail.asp?code=226

ANother approach would be to try the WIndows Management Instrumentaion scripting model ... I was actually poking around at the bios instrumentation when I read your post ... will post if I can extract the info from WMI ..
0
 
LVL 5

Expert Comment

by:mccainz2
ID: 9901031
woohoo!!! getting closer to a pure WMI answer ...

feel free to play along if you like!

http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_bios.asp
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 5

Expert Comment

by:mccainz2
ID: 9901090
getting closer but my bios object is returning all Nulls in its properties...
May post a question on this myself....

 Set objbios = GetObject("winmgmts:root\cimv2:win32_BIOS")
   
    If objbios Is Nothing Then
        MsgBox "No object returned"
    End If
   
    Debug.Print objbios.ReleaseDate
0
 
LVL 5

Expert Comment

by:mccainz2
ID: 9901232
Victory!!! You have a little work on formatting the date but here it is!

    Set BIOSSet = GetObject("winmgmts:").InstancesOf("Win32_BIOS")
   
    For Each System In BIOSSet
       Debug.Print System.ReleaseDate
    Next
0
 
LVL 5

Accepted Solution

by:
mccainz2 earned 50 total points
ID: 9901247
Addendum: I understand now why the earlier code was returning all Nulls... I was creating a proper Bios object but it wasnt initialized from the system , rather it was a virgin object thus all the Null values... I had to actually request an existing WMI object for the code to work.
0
 
LVL 27

Expert Comment

by:planocz
ID: 10217936
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from eagle23 from 12/08/2003 comment
Award points to mccainz2 is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now