Jolteon Posted May 27, 2009 Share Posted May 27, 2009 arkadaşlar auto it programlama dili ile nasıl reg bilgilerini içine entegre edebiliriz yardımcı olabilecek olursa sevinirim Link to comment Share on other sites More sharing options...
CCoder Posted May 27, 2009 Share Posted May 27, 2009 RegWrite("HKEY_CURRENT_USER\.CloneCD", "clone", "REG_SZ", "http://www.falansite.org/") Kardesim biraz arasaydin bulurdun. Ben autoit reg diye arattirdim forumda buldum. Sk8er_boi adminimiz yazmis bunu. Saygilarimla, CCoder. Link to comment Share on other sites More sharing options...
Jolteon Posted May 27, 2009 Author Share Posted May 27, 2009 RegWrite("HKEY_CURRENT_USER\.CloneCD", "clone", "REG_SZ", "http://www.falansite.org/") Kardesim biraz arasaydin bulurdun. Ben autoit reg diye arattirdim forumda buldum. Sk8er_boi adminimiz yazmis bunu. Saygilarimla, CCoder. abı ben bunu zaten biliyorum da benim istediğim toplu halde olacak Link to comment Share on other sites More sharing options...
morning Posted May 27, 2009 Share Posted May 27, 2009 ShellExecuteWait("regedit","/S " & "dosyanınadı.reg",@ScriptDir) Bu komutla yapabilirsin.Ama regedit aracını kullanmadan olmaz. Olur da epey detaylı bir program yazman gerekir, regedit varken bu da çok saçma. Link to comment Share on other sites More sharing options...
Jolteon Posted May 27, 2009 Author Share Posted May 27, 2009 ShellExecuteWait("regedit","/S " & "dosyanınadı.reg",@ScriptDir)Bu komutla yapabilirsin.Ama regedit aracını kullanmadan olmaz. Olur da epey detaylı bir program yazman gerekir, regedit varken bu da çok saçma. peki elinde hiç regtoexe converter programı olan varmı buldum bıtane de deneme sürümüymüş Link to comment Share on other sites More sharing options...
gavara Posted May 27, 2009 Share Posted May 27, 2009 reg2au3 cmenu 2.6 programının içinde var bunu kullanabilirsin Please register to see this content. Link to comment Share on other sites More sharing options...
blackman12 Posted May 27, 2009 Share Posted May 27, 2009 Reg2Au3 Programıyla istediğini yapman mümkün buyur bu da programın kaynak kodları: ; reg2au3;; converts reg files to au3 scripts; reads simple unicode-files (like reg files from regedit windows 2000/xp);; known problem: not all regtypes are supported by autoit; ; by albach_s[b][color=#FF0000]Forumda msn, mail, adres, gerek isim vs. bilgilerinizi paylamaynz[/color][/b].deglobal $file_in, $file_in_handle, $file_in_size, $file_out, $file_out_handleglobal $reg_delete, $reg_key, $reg_valuename, $reg_type, $reg_valueglobal $eof, $lines_written, $lines_read, $file_read_size, $regedit;set default paramsif 1 Then $shortkeys = 0 $regedit = 0 $step = 0 $reg_delete = 0 $reg_key = "" $reg_valuename = "" $reg_type = "" $reg_value = "" $eof = 0 $lines_written = 0 $lines_read = 0 $file_read_size = 0EndIf;start and fileselect-dialogsif 1 then MsgBox(0, "reg2au3", "Welcome to reg2au3 !" & @cr & @CR _ & "With this handy little tool you're able to convert a standard .reg-file" & @CR _ & "(previously exported from registry) to an AutoIt ready .au3-file." & @cr & @cr _ & "Please select source-file and destination-file at the next dialogs" & @cr _ & "and let this script do the rest.") $file_in = FileOpenDialog("reg2au3 - select source-file", "", ".reg-files (*.reg)", 1 ) If @error Then _Error("source-file is needed") $file_in_size = FileGetSize($file_in) If $file_in_size = 0 Then _Error("source-file is empty") $file_out = FileSaveDialog( "reg2au3 - select destination-file", "", "AU3-Scripts (*.au3)", 24, _File_Name($file_in) & "_reghack.au3") If @error Then _Error("destination-file is needed") $a = MsgBox(36, "reg2au3", "Do you like short Registry keys ?" & @cr & @cr _ & "like ""HKLM"" instead of ""HKEY_LOCAL_MACHINE"".") if $a = 6 then $shortkeys = 1EndIf_Files_Open()ProgressOn("reg3au3 - progress", "working ...");main scriptWhile 1 $line = _File_Read_Line() Select case $eof and $line = "" if $step = 1 then _File_Write() ExitLoop case $line = "" case $regedit = 0 if $line = "REGEDIT4" then $regedit = 4 if $line = "Windows Registry Editor Version 5.00" Then $regedit = 5 case StringLeft($line, 1) = "[" And StringRight($line, 1) = "]" ;New REG-Key $reg_valuename = "" $reg_type = "" $reg_value = "" if $shortkeys Then $line = StringReplace($line, "[HKEY_LOCAL_MACHINE", "[HKLM") $line = StringReplace($line, "[HKEY_CLASSES_ROOT", "[HKCR") $line = StringReplace($line, "[HKEY_CURRENT_USER", "[HKCU") $line = StringReplace($line, "[HKEY_USERS", "[HKU") $line = StringReplace($line, "[HKEY_CURRENT_CONFIG", "[HKCC") EndIf $line = StringTrimRight(StringTrimLeft($line, 1), 1) if $step = 1 Then if StringInStr($line, $reg_key) = 0 Then _File_Write() EndIf $reg_key = $line if StringLeft($reg_key, 1) = "-" Then $reg_delete = 1 $reg_key = StringTrimLeft($reg_key, 1) _File_Write() $step = 0 Else $step = 1 EndIf case $step < 1 Case Else $step = 2 $err = 0 if StringLeft($line, 2) = "@=" Then $reg_valuename = "@" $line = StringTrimLeft($line, 2) if $line = "-" then $err = 1 ElseIf StringLeft($line, 1) = '"' Then $pos = 0 $esc = 0 $reg_valuename = "" for $i = 1 to stringlen($line) $a = stringmid($line, $i, 1) Select case $esc $esc = 0 $reg_valuename = $reg_valuename & $a case $a = '\' $esc = 1 case $a = '"' if $i > 1 Then $pos = $i + 1 ExitLoop EndIf case Else $reg_valuename = $reg_valuename & $a EndSelect Next if StringMid($line, $pos, 1) = "=" then $line = StringTrimLeft($line, $pos) Else $err = 2 EndIf Else $err = 3 EndIf if $err Then msgbox(4144, "reg2au3", "Warning:" & @cr & "bad syntax at value-name - " & $err & @cr & "in line: " & $lines_read ) ContinueLoop EndIf if StringLeft($line, 1) = '"' And StringRight($line, 1) = '"' Then $reg_type = "REG_SZ" $pos = 0 $esc = 0 $reg_value = "" for $i = 1 to stringlen($line) $a = stringmid($line, $i, 1) Select case $esc $esc = 0 $reg_value = $reg_value & $a case $a = '\' $esc = 1 case $a = '"' if $i > 1 Then $pos = $i +1 ExitLoop EndIf case Else $reg_value = $reg_value & $a EndSelect Next ElseIf StringLeft($line, 1) = "-" Then $reg_delete = 1 Else $type = StringLeft($line, StringInStr($line, ":")) $line = StringTrimLeft($line, StringLen($type)) Select case $type = "dword:" $reg_type = "REG_DWORD" $reg_value = Dec($line) case $type = "hex(7):" $reg_type = "REG_MULTI_SZ" $reg_value = _Hex_Convert($line) case $type = "hex(2):" $reg_type = "REG_EXPAND_SZ" $reg_value = _Hex_Convert($line) case $type = "hex:" $reg_type = "REG_BINARY" $reg_value = StringReplace($line, ",", "") case StringLeft($type, 3) = "hex" msgbox(4144, "reg2au3", "Warning:" & @cr & "unsupported key-type - " & $type & @cr & "in line: " & $lines_read , 3) ContinueLoop case Else msgbox(4144, "reg2au3", "Warning:" & @cr & "bad syntax at key-type" & @cr & "in line: " & $lines_read ) ContinueLoop EndSelect EndIf _File_Write() EndSelectWEnd;some Types of Registry Values;hex: REG_BINARY;hex(0): REG_NONE - Null value;hex(1): REG_SZ - Null terminated Unicode fixed string value;hex(2): EXPAND_SZ - Null terminated unexpanded Unicode/ANSI environment string value;hex(3): REG_BINARY - Binary value of any form/length;hex(4): REG_DWORD - 32-bit numerical value;hex(4): REG_DWORD_LITTLE_ENDIAN - little-endian 32-bit numerical value (same as REG_DWORD);hex(5): REG_DWORD_BIG_ENDIAN - 32-bit reversed numerical value;hex(6): REG_LINK - Symbolic Unicode link string value;hex(7): REG_MULTI_SZ - Array of multiple Unicode strings separated/ended by null characters;hex(8): REG_RESOURCE_LIST - Device driver list of hardware resources in Resource Map tree;hex(9): REG_FULL_RESOURCE_DESCRIPTOR - List of hardware resources in Description tree;hex(a): REG_RESOURCE_REQUIREMENTS_LIST - Device driver list of hardware resource requirements in Resource Map tree;hex(?): REG_QWORD - 64-bit numerical value;hex(?): REG_QWORD_LITTLE_ENDIAN - little-endian 64-bit numerical value (same as REG_QWORD)_Files_Close();end-dialogif 1 then ProgressSet(100 , "Done", "Complete") sleep(1000) ProgressOff()EndIf;returns converted hex-string suitable to regwriteFunc _Hex_Convert( $hex) local $hex, $i, $a, $string $string = "" for $i = 1 to StringLen($hex) $a = chr(dec(StringMid($hex, $i, 2))) if $a = chr(0) then $a = @lf $string = $string & $a if $regedit = 5 then $i = $i + 5 Else $i = $i + 2 EndIf Next While StringRight($string,1) = @LF $string = StringTrimRight($string, 1) WEnd return $stringEndFunc;extract the filename without extensionFunc _File_Name( $file ) Local $file $fn = StringRight( $file , stringlen( $file ) - StringInStr($file, "\", 0, -1) ) if StringInStr($fn, ".") then $fn = StringLeft($fn, StringInStr($fn, ".")-1) Return $fnEndFunc;returns a string containing the commandlineFunc _Create_Commandline() Local $cmdline if $reg_delete Then $cmdline = "RegDelete(" & chr(34) & _Clean_String($reg_key) & chr(34) if $reg_valuename <> "" Then $cmdline = $cmdline & ", " & chr(34) & _Clean_String($reg_valuename) & chr(34) Else $reg_key = "" EndIf $cmdline = $cmdline & ")" $reg_delete = 0 Else $cmdline = "RegWrite(" & chr(34) & _Clean_String($reg_key) & chr(34) if $reg_valuename <> "" Then if $reg_valuename = "@" then $reg_valuename = "" $cmdline = $cmdline & ", " & chr(34) & _Clean_String($reg_valuename) & chr(34) $cmdline = $cmdline & ", " & chr(34) & $reg_type & chr(34) $cmdline = $cmdline & ", " & chr(34) & _Clean_String($reg_value) & chr(34) EndIf $cmdline = $cmdline & ")" EndIf $reg_valuename = "" $reg_type = "" $reg_value = "" Return $cmdlineEndFunc;cleans given String from @LFFunc _Clean_String( $val ) local $val $val = StringReplace($val, '"', '""') $val = StringReplace($val, @lf, '" & @lf & "') Return $valEndFunc;open the input and output filesFunc _Files_Open() $file_in_handle = FileOpen($file_in, 0) If $file_in_handle = -1 Then _Error( "Unable to open source-file.") $file_out_handle = FileOpen($file_out, 2) If $file_out_handle = -1 Then _Error( "Unable to open destinaion-file.")EndFunc;reads a line from a fileFunc _File_Read_Line() local $line, $a, $b, $c, $r $line = "" $c = 1 While $c $c = 0 $r = "" while 1 $a = FileRead($file_in_handle, 1) If @error = -1 Then $eof = 1 ExitLoop EndIf $file_read_size = $file_read_size + 1 $b = asc($a) if $b > 0 and $b < 254 Then $r = $r & $a if $b = 10 then ExitLoop WEnd $lines_read = $lines_read + 1 _Show_Progress() $r = StringStripWS($r, 3) if StringRight($r, 1) = "\" Then ;regedit uses the backslash to split long lines $r = StringTrimRight($r, 1) $c = 1 EndIf $line = $line & $r WEnd return $lineEndFunc;Write Commandline to OutputfileFunc _File_Write() local $a $a = FileWriteLine( $file_out_handle, _Create_Commandline() ) if $a = 0 Then _Error( "Unable to write to " & $file_in ) $lines_written = $lines_written + 1EndFunc;close the input and output filesFunc _Files_Close() if $file_in_handle then FileClose($file_in_handle) if $file_out_handle then FileClose($file_out_handle)EndFunc;cleanup output filesFunc _Files_Cleanup() FileDelete($file_out)EndFunc;shows the progress barFunc _Show_Progress() local $p $p = int($file_read_size * 100 / $file_in_size) ProgressSet( $p, "current line: " & $lines_read)EndFunc;errorhandlingFunc _Error( $message ) _Files_Close() _Files_Cleanup() ProgressOff() msgbox(16, "reg2au3", "ERROR:" & @cr & $message) ExitEndFunc[/CODE] Link to comment Share on other sites More sharing options...
morning Posted May 28, 2009 Share Posted May 28, 2009 Vay be bunu bilmiyordum bak. Abi nereden buluyorsunuz böyle şeyleri Link to comment Share on other sites More sharing options...
CCoder Posted May 28, 2009 Share Posted May 28, 2009 AutoIT forumlarindan galiba. Link to comment Share on other sites More sharing options...
blue_life Posted May 28, 2009 Share Posted May 28, 2009 Gayet hoş ve başarılı bir script. Ufak fazlalıkları silmek lazım bu arada Link to comment Share on other sites More sharing options...
CCoder Posted May 28, 2009 Share Posted May 28, 2009 Ufak fazlalik ? Bu script temiz bence ! Link to comment Share on other sites More sharing options...
blackman12 Posted May 28, 2009 Share Posted May 28, 2009 Valla benim gördüğümde ufak tefek fazlalıklar var ama madem yazmış o kadar kalsın...Bir (-) getirmediği sürece. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.