Jump to content

learn how to use the class in Autoit


usera
 Share

Recommended Posts

Greeting,

I had a link here

http://msdn.microsoft.com/en-us/library/aa376484%28v=vs.85%29.aspx

class Win32_Tpm
{
  boolean IsActivated_InitialValue;
  boolean IsEnabled_InitialValue;
  boolean IsOwned_InitialValue;
  string  SpecVersion;
  string  ManufacturerVersion;
  string  ManufacturerVersionInfo;
  uint32  ManufacturerId;
  string  PhysicalPresenceVersionInfo;
};

about the win32_Tpm.

Can someone help me how to coding it us autoit?  really want to learn it

Thank

usera

Link to comment
Share on other sites

Learn what exactly?

No error checking here:

#RequireAdmin

$oMTpm = ObjGet("winmgmts:\\.\root\cimv2\Security\MicrosoftTpm")
$oCol = $oMTpm.InstancesOf("Win32_Tpm")


For $oObj In $oCol

    ConsoleWrite($oObj.IsActivated_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsEnabled_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsOwned_InitialValue & @CRLF)
    ConsoleWrite($oObj.SpecVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersionInfo & @CRLF)
    ConsoleWrite($oObj.ManufacturerId & @CRLF)
    ConsoleWrite($oObj.PhysicalPresenceVersionInfo & @CRLF)

Next

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

 

Learn what exactly?

No error checking here:

#RequireAdmin

$oMTpm = ObjGet("winmgmts:\\.\root\cimv2\Security\MicrosoftTpm")
$oCol = $oMTpm.InstancesOf("Win32_Tpm")


For $oObj In $oCol

    ConsoleWrite($oObj.IsActivated_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsEnabled_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsOwned_InitialValue & @CRLF)
    ConsoleWrite($oObj.SpecVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersionInfo & @CRLF)
    ConsoleWrite($oObj.ManufacturerId & @CRLF)
    ConsoleWrite($oObj.PhysicalPresenceVersionInfo & @CRLF)

Next

 

thanks for help.

but I can not get any result from that code

Thanks

Link to comment
Share on other sites

In this case you need to add some error checking. Add a COM error handler if you run AutoIt 3.3.8.1. Check function ObjEvent  for an example.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Search for "AutoIt Scriptomatic Tool" to check whether rootcimv2SecurityMicrosoftTpm WMI class is installed on your system.

Might be that TPM is turned off in the BIOS.

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

 

Learn what exactly?

No error checking here:

#RequireAdmin

$oMTpm = ObjGet("winmgmts:\\.\root\cimv2\Security\MicrosoftTpm")
$oCol = $oMTpm.InstancesOf("Win32_Tpm")


For $oObj In $oCol

    ConsoleWrite($oObj.IsActivated_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsEnabled_InitialValue & @CRLF)
    ConsoleWrite($oObj.IsOwned_InitialValue & @CRLF)
    ConsoleWrite($oObj.SpecVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersion & @CRLF)
    ConsoleWrite($oObj.ManufacturerVersionInfo & @CRLF)
    ConsoleWrite($oObj.ManufacturerId & @CRLF)
    ConsoleWrite($oObj.PhysicalPresenceVersionInfo & @CRLF)

Next

 

thanks,

this is the way to call windows class?

thanks

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