Seite 3 von 3

Re: Systeminformationen

Verfasst: Do, 10. Jul 2014 15:17
von AUGE_OHR
Koverhage hat geschrieben:Hier kommt
no property found ?
hm ... ich hatte nun extra diese Version für 64bit gemacht und bei mir funktioniert es ( sonst hätte ich es nicht upgeloadet )
hat es sonst noch jemand ausprobiert ?

Re: Systeminformationen

Verfasst: Do, 10. Jul 2014 15:29
von Koverhage
Eventuell fehlt mir ein Patch ?
Oder welche Version ist von Xbase++ ist erforderlich.

Ich habe 1.90.355 ohne sl1, die kriege ich hier nicht installiert

Re: Systeminformationen

Verfasst: Do, 10. Jul 2014 21:08
von AUGE_OHR
Koverhage hat geschrieben:Ich habe 1.90.355 ohne sl1, die kriege ich hier nicht installiert
die Version 1.90.355 IST die SL1 Version.

Frage : läuft bei dir der "M$ WMI Creator" ?

Re: Systeminformationen

Verfasst: Fr, 11. Jul 2014 7:20
von Koverhage
Keine Ahnung, wie stelle ich das fest oder wie kann ich den starten ?

Re: Systeminformationen

Verfasst: Fr, 11. Jul 2014 16:20
von AUGE_OHR
Koverhage hat geschrieben:Keine Ahnung, wie stelle ich das fest oder wie kann ich den starten ?
ich meine das, auf Seite 1, erwähnte M$ Tool http://www.microsoft.com/en-us/download ... px?id=8572

Re: Systeminformationen

Verfasst: Di, 05. Aug 2014 11:04
von brandelh
AUGE_OHR hat geschrieben:hi,
du hast die Frage doch im Grund schon mal gestellt http://www.xbaseforum.de/viewtopic.php? ... 8&p=88024&
ich hatte dir ja schon

Code: Alles auswählen

Win32_Processor       -> Prozessor ID
Win32_OperatingSystem -> Windows S/N
gegeben. hier noch Win32_NetworkAdapterConfiguration.zip für MAC Adressen
Win32_NetworkAdapterConfiguration.zip
Ich kann dir (fast) jedes WMI Script als Xbase++ Code generieren nur musst du mir sagen was du willst !
da schlag ich doch gleich mal zu :D

wie übersetzt man das nach Xbase++ ?

Code: Alles auswählen

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia",,48)
Wscript.Echo "SerialNumber, Tag"
Wscript.Echo "-----------------"
For Each objItem in colItems
    Wscript.Echo objItem.SerialNumber & ", " & objItem.Tag
Next

Re: Systeminformationen

Verfasst: Di, 05. Aug 2014 17:39
von AUGE_OHR
brandelh hat geschrieben:da schlag ich doch gleich mal zu :D
wie übersetzt man das nach Xbase++ ?

Code: Alles auswählen

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia",,48)
Wscript.Echo "SerialNumber, Tag"
Wscript.Echo "-----------------"
For Each objItem in colItems
    Wscript.Echo objItem.SerialNumber & ", " & objItem.Tag
Next
als Xbase++ Code wäre es so

Code: Alles auswählen

#include "common.ch"
#include "os.ch"
#define CRLF CHR(13)+CHR(10)

#PRAGMA LIBRARY("ASCOM10.LIB")

PROCEDURE Main(strComputer,cUser,cPassword)
LOCAL objWMIServices
LOCAL colItems
LOCAL cText
LOCAL cName
LOCAL bCollBlock
LOCAL i,iMax
LOCAL j,jMax
LOCAL aitem := {}
// alle Propertys
LOCAL aProp := {;
"Capacity",;
"Caption",;
"CleanerMedia",;
"CreationClassName",;
"Description",;
"HotSwappable",;
"InstallDate",;
"Manufacturer",;
"MediaDescription",;
"MediaType",;
"Model",;
"Name",;
"OtherIdentifyingInfo",;
"PartNumber",;
"PoweredOn",;
"Removable",;
"Replaceable",;
"SerialNumber",;
"SKU",;
"Status",;
"Tag",;
"Version" }

DEFAULT strComputer TO "Localhost"
DEFAULT cUser       TO "Administrator"
DEFAULT cPassword   TO ""

   CLS

   SET ALTER TO Win32_PhysicalMedia.TXT
   SET ALTER ON

   IF VAL( OS(OS_VERSION) ) > 6
      IF strComputer == "Localhost"
         objWMIServices  := CreateObject( "WbemScripting.SWbemLocator" ):ConnectServer(strComputer, "Root\CIMv2")
      ELSE
         IF EMPTY(cPassword)
            MSGBOX("Need Password")
            QUIT
         ELSE
            objWMIServices  := CreateObject( "WbemScripting.SWbemLocator" ):ConnectServer(strComputer, "Root\CIMv2",strComputer+"\"+cUser,cPassword)
         ENDIF
      ENDIF
   ELSE
      objWMIServices  := GetObject("WinMgmts:{impersonationLevel=impersonate}\\"+strComputer+"\Root\CIMv2") 
   ENDIF

   colItems       := objWMIServices:ExecQuery("select * from Win32_PhysicalMedia",,48)
   bCollBlock     := {|oService,n| AADD(aItem,{ n,;
     oService:getProperty("Capacity"),;
     oService:getProperty("Caption"),;
     oService:getProperty("CleanerMedia"),;
     oService:getProperty("CreationClassName"),;
     oService:getProperty("Description"),;
     oService:getProperty("HotSwappable"),;
     oService:getProperty("InstallDate"),;
     oService:getProperty("Manufacturer"),;
     oService:getProperty("MediaDescription"),;
     oService:getProperty("MediaType"),;
     oService:getProperty("Model"),;
     oService:getProperty("Name"),;
     oService:getProperty("OtherIdentifyingInfo"),;
     oService:getProperty("PartNumber"),;
     oService:getProperty("PoweredOn"),;
     oService:getProperty("Removable"),;
     oService:getProperty("Replaceable"),;
     oService:getProperty("SerialNumber"),;
     oService:getProperty("SKU"),;
     oService:getProperty("Status"),;
     oService:getProperty("Tag"),;
     oService:getProperty("Version") })}

   ComEvalCollection(colItems, bCollBlock )

   IF LEN(aItem) > 0
      ? "Win32_PhysicalMedia"
      jMax := LEN(aItem)
      iMax := LEN(aItem[1])
      FOR j := 1 TO jMax
         ?"*****************************************************************************"
         FOR i := 1 TO iMax-1
            ? SUBSTR(aProp[i]+SPACE(40),1,40)+":",aItem[j,i+1]
         NEXT
         ?"*****************************************************************************"
      NEXT
   ELSE
      MSGBOX("no Property found ?")
   ENDIF

   SET ALTER OFF
   SET ALTER TO

   Runshell("Win32_PhysicalMedia.TXT","Notepad.exe",.T.)

RETURN
wenn du nur die SerialNumber haben willst dann entferne alle anderen Propertys aus dem Array aProp / oService:getProperty()

Re: Systeminformationen

Verfasst: Mi, 06. Aug 2014 9:07
von brandelh
Danke für die Info,
mit deinem Code und dem empfohlenen WMI Code Creator ist es ja ein Kinderspiel zu bekommen was man will ...
nachdem man den Laden durchsucht hat. ;-)

Re: Systeminformationen

Verfasst: Mi, 06. Aug 2014 9:34
von brandelh
Wichtig, oben wird so abgefragt

Code: Alles auswählen

IF VAL( OS(OS_VERSION) ) > 6
aber VISTA ist 6.0 und dort funktioniert es auch, also muss es

Code: Alles auswählen

IF VAL( OS(OS_VERSION) ) >= 6
heißen.