English
Source / code snippets

Erfragen Info Ocx Per system Wmi

 

Uwe
''Pascal''
Niemeier
Hi people!

time again what New:
CompileMarkSeparation
window %maxx,%maxy
 $H Windows.ph
 $H ocx3a.ph
 $I ocx3a.inc
ocxInit()
var objLocator&=ocxCreate("WbemScripting.SWbemLocator")
var objService&=ocxMethod(objLocator&,"ConnectServer",".","root\cimv2")
declare Exec$
Exec$="SELECT * FROM Win32_PerfRawData_PerfOS_Memory"----Speicher
Exec$="SELECT * FROM Win32_SystemEnclosure"--------------PC-Gehäuse
Exec$="SELECT * FROM Win32_LogicalDisk"------------------Laufwerke
Exec$="SELECT * FROM Win32_OperatingSystem"--------------Infos über Windows
Exec$="SELECT * FROM Win32_PointingDevice"---------------Infos über Maus
Exec$="SELECT * FROM Win32_USBHub"-----------------------Verfügbare USB-Anschlüsse
Exec$="SELECT * FROM Win32_Printer"----------------------Infos über Drucker
Exec$="SELECT * FROM Win32_Process"----------------------Prozesse
Exec$="SELECT * FROM Win32_QuickFixEngineering"----------HotFixes
Exec$="SELECT * FROM Win32_Product"----------------------Alle installierten Programme
Exec$="SELECT * FROM Win32_StartupCommand"---------------Autostart-Programme
Exec$="SELECT * FROM Win32_NetworkAdapterConfiguration"--verfügbare Netzwerkverbindungen
Exec$="SELECT * FROM Win32_Service"----------------------Services
var Collection&=ocxMethod(objService&,"ExecQuery",Exec$)
var Count%=ocxGet(Collection&,"Count")
var Enum&=ocxGet(Collection&,"_NewEnum")
declare Obj&

whileloop 0,Count%

    CallMethod(Enum&,3,1,Var#,0)--IEnumVARIANT::Next
    casenot Var#.vt%=~VT_DISPATCH:break
    Obj&=Var#.Val&
    print &loop;" von ",Count%
    print ocxMethod(Obj&,"GetObjectText_")
    ocxRelease(Obj&)
    print "<ENTER>"
    waitinput
    cls

endwhile

print "Ende"
ocxRelease(Enum&,Collection&,objService&,objLocator&)
ocxDeInit()
waitinput

BTW1: there The request a SQL-commands results,
can itself the Result in the Vorfeld over suitable WHERE-terms eingrenzen.

BTW2: too The spending can itself on single Datenfelder limit.
there but not any Datensätze The same boxes include (not even within of/ one
system-category), would with request one not vorhandenen Field The Error Message "Unbekannter Name" erfolgen.
this can itself suppress through Änderung the ocx-internen ErrorLevels.
CompileMarkSeparation
window %maxx,%maxy
 $H windows.ph
 $H ocx3a.ph
 $I ocx3a.inc
ocxInit()
var Exec$=" SELECT * FROM Win32_LogicalDisk WHERE FileSystem = FAT32 "
var objLocator&=ocxCreate("WbemScripting.SWbemLocator")
var objService&=ocxMethod(objLocator&,"ConnectServer",".","root\cimv2")
var Collection&=ocxMethod(objService&,"ExecQuery",Exec$)
var Count%=ocxGet(Collection&,"Count")
var Enum&=ocxGet(Collection&,"_NewEnum")
declare Obj&

whileloop 1,Count%

    CallMethod(Enum&,3,1,Var#,0)--IEnumVARIANT::Next
    casenot Var#.vt%=~VT_DISPATCH:break
    Obj&=Var#.Val&
    ocxErrorlevel%=0--Error Message because of "Irgendwas" suppress
    print "Name       : ",ocxGet(Obj&,"Name")
    print "Description: ",ocxGet(Obj&,"Description")
    print "Irgendwas  : ",ocxGet(Obj&,"Irgendwas")
    ocxErrorLevel%=1--Fehlermeldungen as a precaution again to permit
    ocxRelease(Obj&)

endwhile

ocxRelease(Enum&,Collection&,objService&,objLocator&)
ocxDeInit()
waitkey

thanks all here [...]  and here [...]  beteiligten for Why stay to!

SeeYou
Pascal
 
04/05/10  
 



Genial, functions super!

(such tollen Codes erinner me always a tolles Codesnippets/ Thread- groups- and Schlagwortezuordnungssystem" the me there vorschwebt, so one z.B. too through Codesnippets-Rubriken browsen can)
 
04/05/10  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.910 Views

Untitledvor 0 min.
p.specht12/22/18
Andre Rohland01/01/14
Michael Borowiak04/16/13
Rolf Koch10/28/12
More...

Themeninformationen

this Topic has 2 subscriber:

iF (1x)
Uwe ''Pascal'' Niemeier (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie