Solved

Function for BIOS Date

Posted on 2003-12-08
8
401 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

822 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