Jump to content

Computer Info from Powershell


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

Well you are referencing a post from 8 years ago, not exactly shocked that it isn't working. How about posting the exact script you're using

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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

 

 

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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