Custom Query (3933 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (460 - 462 of 3933)

Ticket Resolution Summary Owner Reporter
#805 No Bug Don't really know what command is causing the problem Emiel Wieldraaijer
Description

I use a script from Danny35d to display office and windows serials. After updating to 3.3.0.0 the returned information is not correct anymore.

#include <Array.au3>

$HKLM = "HKEY_LOCAL_MACHINE"
If @OSArch = "X64" Then 
	$HKLM &= "64"
EndIf

$OfficeKey = _GetOfficeKey()

_ArrayDisplay($OfficeKey, 'Office Key')

$HKLM = "HKEY_LOCAL_MACHINE"
If @OSArch = "X64" Then 
	$HKLM &= "64"
EndIf

;===============================================================================
;
; Function Name:    _GetWindowsKey()
; Description:      gets the Windows DigitalProductID from the registry
; Parameter(s):     none
; Requirement(s):   none
; Return Value(s):  Returns the binary Windows DigitalProductID as stored in the registry
; Author(s):        Danny35d
;
;===============================================================================
; TBD: Error checking and SetError
Func _GetWindowsKey($sRemoteComputer = '')
    Dim $aKeys[2][5]
    
    If $sRemoteComputer <> '' Then $sRemoteComputer = '\\' & StringReplace($sRemoteComputer, '\', '') & '\'
    Local Const $sRegKey = $sRemoteComputer & $HKLM & '\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
    
    $aKeys[0][0] = 1
    $aKeys[1][0] = RegRead($sRegKey, 'ProductName')
    $aKeys[1][1] = RegRead($sRegKey, 'ProductID')
    $aKeys[1][2] = _DecodeProductKey(RegRead($sRegKey, 'DigitalProductID'))
    $aKeys[1][3] = RegRead($sRegKey, 'RegisteredOwner')
    $aKeys[1][4] = RegRead($sRegKey, 'RegisteredOrganization')
    Return($aKeys)
EndFunc   ;==>_GetWindowsKey

;===============================================================================
;
; Function Name:    _GetOfficeKey()
; Description:      gets the Office DigitalProductID from the registry
; Parameter(s):     none
; Requirement(s):   none
; Return Value(s):  Returns the binary 2003 Office DigitalProductID as stored in the registry
; Author(s):        Danny35d
;
;===============================================================================
; TBD: Error checking and SetError
Func _GetOfficeKey($sRemoteComputer = '')
    Dim $aKeys[1][3]
    If $sRemoteComputer <> '' Then $sRemoteComputer = '\\' & StringReplace($sRemoteComputer, '\', '') & '\'
    Local $sRegKey1 = $sRemoteComputer & $HKLM & '\SOFTWARE\Microsoft\Office'
    Local $sRegKey2 = $sRemoteComputer & $HKLM & '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
    Local $iCount1 = 1, $iCount2 = 1
    
    While 1
        $sKey1 = RegEnumKey($sRegKey1, $iCount1)
        If @error <> 0 Then ExitLoop
        While 1
            $ProductID = ''
            $ProductName = ''
            $DigitalProductID = ''
            $sKey2 = RegEnumKey($sRegKey1 & '\' & $sKey1 & '\Registration', $iCount2)
            If @error <> 0 Then ExitLoop
            $ProductID = RegRead($sRegKey1 & '\' & $sKey1 & '\Registration\' & $sKey2, 'ProductID')
            $ProductName = RegRead($sRegKey1 & '\' & $sKey1 & '\Registration\' & $sKey2, 'ProductName')
            $DigitalProductID = RegRead($sRegKey1 & '\' & $sKey1 & '\Registration\' & $sKey2, 'DigitalProductID')
			$InstallPath = StringTrimRight((RegRead ($sRegKey1 & '\' & $sKey1 & '\Common\InstallRoot', 'Path')),1)
			$ProductVersion = RegRead($sRegKey1 & '\' & $sKey1 & '\Common\Productversion', 'Lastproduct')
			$OfficeLanguage = StringRight(Hex(RegRead($sRegKey1 & '\' & $sKey1 & '\Common\LanguageResources', 'SKULanguage')),4)
			
            If $ProductName = '' Then $ProductName = RegRead($sRegKey2 & '\' & $sKey2, 'DisplayName')
            $DigitalProductID = _DecodeProductKey($DigitalProductID)
            If $DigitalProductID <> 'BBBBB-BBBBB-BBBBB-BBBBB-BBBBB' Then 
                ReDim $aKeys[UBound($aKeys) + 1][6]
                $aKeys[0][0] = UBound($aKeys) - 1
                $aKeys[UBound($aKeys) - 1][0] = $ProductName
                $aKeys[UBound($aKeys) - 1][1] = $ProductID
                $aKeys[UBound($aKeys) - 1][2] = $DigitalProductID       
				$aKeys[UBound($aKeys) - 1][3] = $InstallPath
				$aKeys[UBound($aKeys) - 1][4] =	$ProductVersion
				$aKeys[UBound($aKeys) - 1][5] = $OfficeLanguage
            EndIf
			
            $iCount2 += 1
        WEnd        
        $iCount1 += 1      
    WEnd
    Return($aKeys)
EndFunc   ;==>_GetOfficeKey

;===============================================================================
;
; Function Name:    _DecodeProductKey()
; Description:      decodes the PID to get the product key
; Parameter(s):     $BinaryDPID - the PID as stored in registry
; Requirement(s):   none
; Return Value(s):  Returns the decoded Windows/Office/Visual studio/etc. product key
; Author(s):        found this in the Forum, who made it?!
;
;===============================================================================
Func _DecodeProductKey($BinaryDPID)
    Local $bKey[15]
    Local $sKey[29]
    Local $Digits[24]
    Local $Value = 0
    Local $hi = 0
    Local $n = 0
    Local $i = 0
    Local $dlen = 29
    Local $slen = 15
    Local $Result
    
    $Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")
    $binaryDPID = StringMid($binaryDPID, 105, 30)
    For $i = 1 To 29 Step 2
        $bKey[Int($i / 2) ] = Dec(StringMid($binaryDPID, $i, 2))
    Next
    
    For $i = $dlen - 1 To 0 Step - 1
        If Mod(($i + 1), 6) = 0 Then
            $sKey[$i] = "-" 
        Else
            $hi = 0
            For $n = $slen - 1 To 0 Step - 1
                $Value = BitOR(BitShift($hi, -8), $bKey[$n])
                $bKey[$n] = Int($Value / 24)
                $hi = Mod($Value, 24)
            Next
            $sKey[$i] = $Digits[$hi + 1]
        EndIf      
    Next
    For $i = 0 To 28
        $Result = $Result & $sKey[$i]
    Next    
    Return $Result
EndFunc   ;==>_DecodeProductKey
#806 No Bug DllStructGetData fails in compiled script with a name longer than 12/13 characters autoit@…
Description

The script below will work fine in AutoIT 3.3.0.0 as long as it is not compiled. It requires two parameters given in the command line:

  1. IP address of the DHCP server
  2. IP address of the client to look for

It will query the DHCP server (at least 'DHCP User' permissions are required on the DHCP server) and return the name of the client that has the given IP address as a lease (the error might happen on other uses of DllStructGetData, but I've noticed it with this one).

Once it is compiled, the exe sometimes will end with an application error in the function "_DHCP_GetClientNameByIP": $sClientName = DllStructGetData($tClientNameString, "ClientName") but only if the name of the exe is

  • 12 characters or longer on Server 2003 SP2
  • 13 characters or longer on Windows XP SP3

If the file name is shorter, it seems to run without problems. In some setups, it crashes "reliably" on some IP addresses, but works on others, in some it only crashes sometimes (while querying the same IP address). In the case of the "reliable" crash, the crashes will stop as soon as the exe is renamed to something shorter than 12/13 characters. The crashes happen on 3.2.12.1 as well, but I've only yet verified the solution on 3.3.0.0.

The function below is, for demonstration purposes, a stripped-down version of Alexander Melnichuk's _DHCP_GetClientInfo, found at http://www.autoitscript.com/forum/index.php?showtopic=74295 In case it's needed, MS information for the DHCP query: DhcpGetClientInfo Function http://msdn.microsoft.com/en-us/library/aa363286(VS.85).aspx DHCP_SEARCH_INFO Structure http://msdn.microsoft.com/en-us/library/aa363370(VS.85).aspx DHCP_CLIENT_INFO Structure http://msdn.microsoft.com/en-us/library/aa363348(VS.85).aspx

;===============================================================================
;
; Description:      Get DHCP Client Attributes by IP Address
; Parameter(s):     $sDHCP - IP Address of DHCP Server
;                   $ClientID - Client IP(String)
; Return Value(s):  On Success - The name of the client
;                   On Failure - Null, @error set to
;                     1 - Client not found on DHCP server
;                     2 - Invalid ClientID parameter
;                     3 - Operating System not supported
;                     4 - Any Runtime Error, API Error Code set to @extended
; Author(s):         amel27 (Alexander Melnichuk)
; Note(s):           Client Name is case sensitive
;
;===============================================================================
Func _DHCP_GetClientNameByIP($sDHCP, $sClientID)
; Create DHCP_SEARCH_INFO Structure
Local $tSearchInfo
Local $tClientInfo
Local $iSearchInfoPtr
Local $tSearchInfo_IP
Local $tClientInfo_Ptr
Local $tClientNameString
Local $aOctets
Local $i, $aRet
Local $sClientName
Local $iClientIP
	$tSearchInfo = DllStructCreate("int SearchType;int DataLength;ptr DataPtr")
	$iSearchInfoPtr = DllStructGetPtr($tSearchInfo)
	If StringRegExp($sClientID, "^(\d+\.){3}\d+$") Then
		; Get IP DWord type from String
		$iClientIP = 0
		$aOctets = StringSplit($sClientID, ".")
		For $i = 1 To 4
			If BitAND($aOctets[$i], 0xFFFFFF00) Then Return SetError(2) ; ERR: Invalid Client IP Address
			$iClientIP = BitOR(BitRotate($iClientIP, 8, "D"), $aOctets[$i])
		Next
	Else
		Return SetError(2)
	EndIf
	; Route the filling of DHCP_SEARCH_INFO structure
	; Filling DHCP_SEARCH_INFO for search by client IP address
	$tSearchInfo_IP = DllStructCreate("int SearchType;dword ClientIPAddress", $iSearchInfoPtr)
	DllStructSetData($tSearchInfo_IP, "SearchType", 0)
	DllStructSetData($tSearchInfo_IP, "ClientIPAddress", $iClientIP)
	; Call  DhcpGetClientInfo API function
	$tClientInfo_Ptr = DllStructCreate("ptr")
	$aRet = DllCall("Dhcpsapi.dll", "int", "DhcpGetClientInfo", _
		"wstr", $sDHCP, _ 
		"ptr", $iSearchInfoPtr, _
		"ptr", DllStructGetPtr($tClientInfo_Ptr))
	If @error Then Return SetError(3, @error) ; ERR: Invalid DLL or Function Name
	If ($aRet[0] = 20013) Then Return SetError(1, $aRet[0]) ; ERR: Client not found
	If $aRet[0] Then Return SetError(4, $aRet[0]) ; ERR: Any runtime errors
	; DHCP_CLIENT_INFO structure
	$tClientInfo = DllStructCreate("dword ClientIpAddress;dword SubnetMask;int BinaryLen;ptr BinaryPtr;" & _
		"ptr ClientNamePtr;ptr ClientCommentPtr;ubyte ClientLeaseExpires[8];dword OwnerHostIPAddress;" & _
		"ptr OwnerHostNetBiosNamePtr;ptr OwnerHostNamePtr", DllStructGetData($tClientInfo_Ptr, 1))
	; Get Client Name
_FileWriteLog($strLogFile, "Creating DLL Structure for ClientName")
	$tClientNameString = DllStructCreate("wchar ClientName[255]", DllStructGetData($tClientInfo, "ClientNamePtr"))
_FileWriteLog($strLogFile, "Retrieving ClientName")
	$sClientName = DllStructGetData($tClientNameString, "ClientName")
_FileWriteLog($strLogFile, "Name: " & $sClientName & " ... releasing memory")
	DllCall("Dhcpsapi.dll", "none", "DhcpRpcFreeMemory", "ptr", DllStructGetData($tClientInfo_Ptr,1))
	Return $sClientName
EndFunc

; ========== Main ================================================================================

If ($CmdLine[0] < 2) Then
	MsgBox(0, "Syntax", "Syntax: " & @ScriptName & " <IP DHCP server> <IP DHCP Client>")
	Exit(1)
EndIf
Dim $strDHCPServerIP = $CmdLine[1]
Dim $strDHCPClientIP = $CmdLine[2]
Dim $strDHCPClientInfo[6]
Dim $strDHCPClientName
; If FileExists($strLogFile) Then FileDelete($strLogFile)
_FileWriteLog($strLogFile, "--------------------------------------------------------------------------------")
$strDHCPClientName = _DHCP_GetClientNameByIP($strDHCPServerIP, $strDHCPClientIP)
MsgBox(0, "Result", "Host name of DHCP client " & $strDHCPClientIP & ": " & $strDHCPClientName, 2)

#807 Rejected help anonymous
Description

plese add a way to check the processor type ie: pentum d , Pentium III. I would also like to check the speed of the CPU. also check the direct x if pocible and check the graphics thank you for the help

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.