Solved

Function for BIOS Date

Posted on 2003-12-08
8
398 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

895 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

14 Experts available now in Live!

Get 1:1 Help Now