Jump to content

Input'a Girilen Veriyi Regedit'e Yazma


Mehmet
 Share

Recommended Posts

değiştir butonuna tıkladığımda inputda farklı pc ismi yazdıysam regeditde ilgili anahtara yazmasını istiyorum ama yapamadım
[codebox]
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
global $computername
$guim = GUICreate("PC AD DEĞİŞTİR", 311, 591, 192, 125)
$computername = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName")
;$regadgir = RegWrite("\\" & $inputbox & "\HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName', 'ComputerName', 'REG_SZ','')
$inputbox = GUICtrlCreateInput($computername,108,336)
GUICtrlSetTip(-1, "BİR AD GİRİNİZ")
$pcadi = GUICtrlCreateLabel("Bilgisayar adı", 176, 312, 65, 17)
$degistir = GUICtrlCreateButton("Değiştir", 176, 368, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE

Exit

Case $degistir
;$regadgir
adgirdi()

EndSwitch
WEnd

Func adgirdi()

$computername = GuiCtrlRead($inputbox)

EndFunc
[/codebox] Edited by MeHMeTBeN
Link to comment
Share on other sites

[codebox]#include <GUIConstantsEx.au3>

Global $guim = GUICreate("PC AD DEĞİŞTİR", 311, 591, 192, 125)

;$regadgir = RegWrite("\\" & $inputbox & "\HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName', 'ComputerName', 'REG_SZ','')
Global $inputbox = GUICtrlCreateInput(RegRead("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName"), 108, 336)
GUICtrlSetTip(-1, "BİR İSİM GİRİNİZ")
GUICtrlCreateLabel("Bilgisayar adı", 176, 312, 65, 17)
Global $degistir = GUICtrlCreateButton("Değiştir", 176, 368, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE

Exit

Case $degistir
_RenameComputer()

EndSwitch
WEnd

Func _RenameComputer()
Local $Read_Com_Input = StringStripWS(GUICtrlRead($inputbox), 3)
Local $Read_Reg_Input = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName")
If $Read_Com_Input = $Read_Reg_Input Then Return 0
If $Read_Com_Input = "" Then
GUICtrlSetData($inputbox, $Read_Reg_Input)
GUICtrlSetState($inputbox, 256)
Return SetError(1, 0, 0)
EndIf
;~ RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", $Read_Com_Input)
RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $Read_Com_Input)
;~ RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $Read_Com_Input)
;~ RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $Read_Com_Input)
;next line is not really needed, but makes things easier during initial config. It just sets the default domain to the new local machine name.
;~ RegWrite("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $Read_Com_Input)
EndFunc ;==>_RenameComputer[/codebox]

Link to comment
Share on other sites

blue_life devredışı bıraktığınız regedit anahtarları var sanırım bu
RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", $Read_Com_Input)
bilgisayara reset atmadan değiştiriyor diğerlerini bilmiyorum ama aktif etsem negibi değişiklikler olur

Edited by MeHMeTBeN
Link to comment
Share on other sites

  • 3 hafta sonra ...

@blue_life regedit anahtarımız sadece bu şekilde ise
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
veya
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg]

Run yada startupreg anahtarı altında olanları Checkboxlara yazdırabilirmiyiz

Başlat çalıştır msconfig başlangıçda çalışan programları kaldırıyorum kendini
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg] buradaki anahtar adı altına atıyor dolasıyla oradanda silmemiz gerekiyor

Link to comment
Share on other sites

yardım dosyasında böyle bir örnek vardı ama ben pek mantığı kuramadım çünki ini dosyasına yazıyor blackman12 üstad sen dahada zorlaştırdın :D
MsgBox örneği değilde Checkbox örneği verseydin keşke ama run adı altında kaçtane program çalışıyor bunu tahmin edemeyiz kaçtane checkbox yapıcaz :(
[codebox]
$sIni = @DesktopDir & "\Aboo.ini"
For $i = 1 To 10
$var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
IniWriteSection($sIni,"List Startup",$var)
If @error Then ExitLoop
Next
$chars = FileRead($sIni)
MsgBox(0,"",BinaryToString($chars))
[/codebox]

Edited by MeHMeTBeN
Link to comment
Share on other sites

[code]Opt("GUIResizeMode", 802)
Dim $checkler[1] = [0]
$yol = "HKEY_CURRENT_USER\Software\HavvaDurumu"
$gui = GUICreate("deneme",200,200,0,20)
GUICtrlSetResizing (-1, 856);burayı hatırlayamadım
$y = 25
for $i = 1 to 100000
$reg = RegEnumVal($yol,$i)
if $reg = "" Then
ExitLoop
Else
ReDim $checkler[$i]
$checkler[$i-1] = GUICtrlCreateCheckbox($reg,20,$y,200,20)
$y += 25
EndIf
Next
WinMove($gui,"",Default,Default,200,$y + 50)
GUISetState()

While 1
$nmsg = GUIGetMsg()
if $nmsg = -3 Then
Exit
Elseif $nmsg = $checkler[2] Then
MsgBox(0,"","deneme")
EndIf
WEnd[/code]

Link to comment
Share on other sites

blue_lifenin Regopenkey V1.5 olan çalışmasındaki gibi ben daha önceden belirlemiş olduğum bir kayıt defteri anahtarına ulaşmak için bir butona tıkladığımda direk kayıt defterindeki o alanı açmasını istiyorum nasıl yaparım
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
ve
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'UnlockerAssistant', 'REG_SZ','"

bir başka sorumda
RegEnumKey RegEnumVal ile aynımı

Link to comment
Share on other sites

peki bir butona tıkladığımda bu anahtarları açmak için hangi komutu kullanıyoruz.?
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
veya
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run', 'UnlockerAssistant', 'REG_SZ','"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...