Jump to content

Recommended Posts

Posted

@water, your post from here is of good help.

There are few details which are appearing as blank. Could you please help on this?

$Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF

 

Posted

Maybe you want to know the install date of the operating system?

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Posted

@Nessie, Yes.

@Andreik, I have already got all the required results coming through the registry side.

But I am seeing some of the features read from the registry is not appearing correctly on the New Models. Now this is working fine all almost all but regread doesn't on few. Looks like, this needs to be also checked by AutoIT forum.

So, I am trying to get all system details reporting in msinfo32 via the PowerShell.

Posted (edited)

If you are going to ask autoit to ask powershell to ask msconfig to ask wmi, why not just ask wmi?

wmic CSPRODUCT GET NAME

or in computersystem with these two:

WMIC COMPUTERSYSTEM GET MODEL
WMIC COMPUTERSYSTEM GET MANUFACTURER

 

Edited by iamtheky

  Reveal hidden contents

Posted

Ok, it's fixed now.

I had to get it changed

from:

"SELECT * FROM Win32_ComputerSystem"

to:

"SELECT * FROM Win32_OperatingSystem"

Global $GetInstallDate


$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$ComputerName = "localhost"

$Output=""
$objWMIService = ObjGet("winmgmts:\\" & $ComputerName & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
                                        $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
        $GetInstallDate = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
        $Output=""
   Next
Else
;~    Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_ComputerSystemProduct" )
Endif


Func WMIDateStringToDate($dtmDate)
    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" &  StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc


MsgBox(0, '', $GetInstallDate)

 

Posted

same thing on the cli. wmic seems to retrieve faster.  quicker to write as well if you only need one or two things and you can reuse the date formatter because its the same stuff.

$iPid = Run("WMIC OS GET InstallDate" , @ScriptDir , @SW_HIDE , 0x2)

$sOut = ""

Do
    $sOut &= StdoutRead($iPID)
Until @error

msgbox(0, '' , WMIDateStringToDate(stringtrimleft($sOut , 30)))



Func WMIDateStringToDate($dtmDate)
    Return (StringMid($dtmDate, 5, 2) & "/" & _
    StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
    & " " & StringMid($dtmDate, 9, 2) & ":" &  StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc

 

 

 

  Reveal hidden contents

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...