Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Function for BIOS Date

Posted on 2003-12-08
8
Medium Priority
?
431 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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 150 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

886 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