Jump to content

Search the Community

Showing results for tags 'reg'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 4 results

  1. good morning everybody. today i liked to share an small example with you which it an function to read the registry values as an array the result array is 2d array witch $a_array[n][0] = value name $a_array[n][1] = value Data $a_array[0][0] = values count here's the function #include <Array.au3> #include <WinAPIReg.au3> #include <APIRegConstants.au3> Local $a_array = _RegReadToArray("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run") If @error Then MsgBox(16, "error", @error) Exit EndIf _ArrayDisplay($a_array) Func _RegReadToArray($s_RegKey) Local $a_KeySplitInfo = StringSplit($s_RegKey, "\\", 2) If UBound($a_KeySplitInfo) <= 1 Then $a_KeySplitInfo = StringSplit($s_RegKey, "\", 2) If UBound($a_KeySplitInfo) <= 1 Then Return (1, 1, 0) EndIf Local $H_KeyInfo = "", $s_RegKeyInfo = "" Switch $a_KeySplitInfo[0] Case "hklm", "HKEY_LOCAL_MACHINE", "hklm64", "HKEY_LOCAL_MACHINE64" $H_KeyInfo = $HKEY_LOCAL_MACHINE Case "hkCu", "HKEY_CURRENT_USER", "hkCU64", "HKEY_CURRENT_USER64" $H_KeyInfo = $HKEY_CURRENT_USER Case "hkCr", "HKEY_CLASSES_ROOT", "HKCR64", "HKEY_CLASSES_ROOT64" $H_KeyInfo = $HKEY_CLASSES_ROOT Case "HKU", "HKEY_USERS", "HKU64", "HKEY_USERS64" $H_KeyInfo = $HKEY_USERS Case Else Return SetError(2, 2, 0) EndSwitch _ArrayDelete($a_KeySplitInfo, 0) $s_RegKeyInfo = _ArrayToString($a_KeySplitInfo, "\") Local $H_KeyInfoOpen = _WinAPI_RegOpenKey($H_KeyInfo, $s_RegKeyInfo, $KEY_READ) Local $A_KeyInfo = _WinAPI_RegQueryInfoKey($H_KeyInfoOpen) If @error Then Return SetError(1, 1, 0) _WinAPI_RegCloseKey($H_KeyInfoOpen) Local $A_RegVal[$A_KeyInfo[2] + 1][2] Local $iV = 1, $s_RegRead = "" While 1 $s_RegVal = RegEnumVal($s_RegKey, $iV) If @error <> 0 Then ExitLoop $s_RegRead = RegRead($s_RegKey, $s_RegVal) If Not (@error) Then $A_RegVal[$iV][0] = $s_RegVal $A_RegVal[$iV][1] = $s_RegRead EndIf $iV += 1 WEnd $A_RegVal[0][0] = UBound($A_RegVal) - 1 If $A_RegVal[0][0] >= 1 Then Return $A_RegVal Else Return SetError(3, 3, 0) EndIf EndFunc ;==>_RegReadToArray i hope you benefit from it with my greetings
  2. Hi, I found this script for exporting registry file as text from Smartee. https://www.autoitscript.com/forum/topic/126953-export-several-registry-keys-into-one-file/ $path = @DesktopDir & "\registry.txt" $cache = "" ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.ico") $cache &= FileRead($path) ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.eml") $cache &= FileRead($path) ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.txt") $cache &= FileRead($path) FileOpen($path, 2) FileWrite($path, $cache) FileClose($path) However, it is not working in my end. I can only export blank text. I am trying to export the registry from a distiller. I also noticed the extensions(.ico, .eml and .txt) at the end of the key. However, this is not available in the distiller. Any suggestions? $path = @ScriptDir & "\registry.txt" $cache = "" ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\10.0\WatchedFolders\") $cache &= FileRead($path) FileOpen($path, 2) FileWrite($path, $cache) FileClose($path)
  3. So i have this string that i am trying to split up into an array. {"q1":{"a2":[0,1],"a5":[0,0],"a3":[0,1],"a4":[0,0],"a1":[1,0]},"q2":{"a1":[1,1],"a2":[0,1]},"q3":{"a2":[1,0],"a4":[0,0],"a5":[0,0],"a3":[0,0],"a1":[0,1]},"q4":{"a2":[1,1],"a4":[0,1],"a1":[0,0],"a5":[0,1],"a3":0,0]},"q5":{"a1":[1,1],"a5":[0,1],"a4":[0,0],"a3":[0,0],"a2":[0,0]},"q6":{"a1":[1,1],"a4":[0,1],"a2":[0,1],"a3":[0,1]},"q7":{"a5":[1,0],"a3":[0,1],"a2":[0,1],"a1":[0,0],"a4":[0,1]},"q8":{"a3":[1,1],"a4":0,1],"a2":[0,1],"a1":[0,1]},"q9":{"a1":[1,0],"a2":[0,0]}}}} What i am trying to accomplish is build a RegExp that will output something very similar to this: $aArray[0] = "q1":{"a2":[0,1],"a5":[0,0],"a3":[0,1],"a4":[0,0],"a1":[1,0]}," $aArray[1] = "q2":{"a1":[1,1],"a2":[0,1]}, $aArray[3] = "q3":{"a2":[1,0],"a4":[0,0],"a5":[0,0],"a3":[0,0],"a1":[0,1]}, .... So you can see i pretty much want the StringRegExp to grab all of the information inbetween "q\d" Here is what i have done so far: #include <Array.au3> $hResults = FileOpen("Results.txt", 0) $sResults = FileRead($hResults) $aQuestions = StringRegExp($sResults, '"q\d{1,}.*', 3) ConsoleWrite(@error & @CRLF & @extended & @CRLF) _ArrayDisplay($aQuestions) The output i get is $aQuestions[0] with the entire string. I tried less greedy options for the '.' by adding ++ or +? but neither are working. Hopefully i explained it well enough. Any help is appreciated!
  4. This UDF contains functions that help managing the configuration of your scripts. You can use either an *.ini file, or registry keys, the UDF manage for you all IniRead/IniWrite or RegRead/RegWrite calls. Instructions First, you must call _AutoCfg_Init to setup the system, which method will be used to stor the config (ini/reg), the path (ini file/reg key) and various options (data encryption, ini file section). After that, you must add the configuration entries that will be used, with their respective default value (use _AutoCfg_AddEntry). Next, you must call _AutoCfg_Update to update every entry with either it’s corresponding value on the disk (ini/reg) or with it’s default value if no value is present on the disk. Finally, you can use in your script the function CFG to get the current value of an entry, or an array of all the entries and their values and default values. And the function _AutoCfg_SetEntry the set the value of an entry or set it to it’s default value. UDF_autoCfg.zip
×
×
  • Create New...