Advertisement
AZJIO

Считывание сетевых настроек

Jan 23rd, 2013
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.62 KB | None | 0 0
  1. ; @AZJIO
  2. #include <Array.au3>
  3.  
  4. ; $sPathWindows = FileSelectFolder('Указать каталог Windows', '')
  5. ; If @error Then Exit
  6. ; Run(@ComSpec & ' /C REG LOAD HKLM\LM_SOFTWARE"' & $sPathWindows & '\system32\config\software"', '', @SW_HIDE)
  7.  
  8. $i = 1
  9. Global $aKey[1][6] = [[0]]
  10. While 1
  11.     $sKey = RegEnumKey('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services', $i)
  12.     If @error Then ExitLoop
  13.     If StringLeft($sKey, 1) = '{' And _RegExists('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip') Then
  14.         $aKey[0][0] += 1
  15.         ReDim $aKey[$aKey[0][0] + 1][6]
  16.         $aKey[$aKey[0][0]][0] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'DefaultGateway')
  17.         $aKey[$aKey[0][0]][1] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'IPAddress')
  18.         $aKey[$aKey[0][0]][2] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'SubnetMask')
  19.         $aKey[$aKey[0][0]][3] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'DhcpIPAddress')
  20.         $aKey[$aKey[0][0]][4] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'DhcpServer')
  21.         $aKey[$aKey[0][0]][5] = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\' & $sKey & '\Parameters\Tcpip', 'DhcpSubnetMask')
  22.     EndIf
  23.     $i += 1
  24. WEnd
  25.  
  26. _ArrayDisplay($aKey, 'aKey')
  27.  
  28. Func _RegExists($sKey)
  29.     RegRead($sKey, '')
  30.     Return Not (@error > 0)
  31. EndFunc   ;==>_RegExists
  32.  
  33. ; HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement