Jump to content

fikri1979

Active Members
  • Posts

    46
  • Joined

  • Last visited

Recent Profile Visitors

196 profile views

fikri1979's Achievements

  1. thank you all, i'had tried running it manually in Admin mode.it and succesfully
  2. I finally tried the following script and successfully ... is there any other way that is more practical? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Global $readpath = IniRead(@ScriptDir & "\Config.ini","Path", "injek", "NotFound") #Region ### START Koda GUI section ### Form=latihan shel execute.kxf $Form1_1 = GUICreate("Form1", 340, 133, 285, 191) $btnstart = GUICtrlCreateButton("START", 48, 48, 89, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $btnstop = GUICtrlCreateButton("STOP", 160, 48, 89, 25) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $lokasinjek = GUICtrlCreateInput($readpath, 40, 16, 233, 21) $btnganti = GUICtrlCreateButton("....", 280, 16, 33, 25) $Inputtitle = GUICtrlCreateInput("pid", 160, 88, 113, 21) $Label1 = GUICtrlCreateLabel("TITLE", 96, 88, 34, 17) GUISetState(@SW_SHOW) cek() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnganti $MyFile = FileOpenDialog('Browse', '', 'All files (*.*)', 1) GUICtrlSetData($lokasinjek, $MyFile) case $btnstart Example() case $btnstop stop() EndSwitch WEnd Func cek() GUICtrlSetState($btnstart, $gui_enable) GUICtrlSetState($btnstop, $gui_disable) EndFunc Func Example() ShellExecute(GUICtrlRead($lokasinjek)) GUICtrlSetState($btnstart, $gui_disable) GUICtrlSetState($btnstop, $gui_enable) sleep(1000) ; Retrieve the window title of the active window. GUICtrlSetData($Inputtitle,WinGetProcess("[ACTIVE]")) EndFunc Func stop() ProcessClose(GUICtrlRead($Inputtitle)) GUICtrlSetState($btnstart, $gui_enable) GUICtrlSetState($btnstop, $gui_disable) EndFunc
  3. Hello all, I just installed autoit 3.10.2 + scite4autoit in windows 8 and when running the tool code wizard but I get an error message like this below how to fix it?
  4. i'm sorry i don't know cause i'm beginner.. how to correct it my script?
  5. once again,... How about this 1. when click the exit button it will automatically close that external software too.. 2. When click the "Start" Button then It will disable Start Button.. i have tried like this, how to correct it? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $readpath = IniRead(@ScriptDir & "\Config.ini","Path", "soft", "NotFound") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 463, 138, 298, 267) $Input1 = GUICtrlCreateInput($readpath, 56, 16, 265, 21) $Button1 = GUICtrlCreateButton("LOAD", 336, 16, 49, 25) $Button2 = GUICtrlCreateButton("START", 184, 64, 105, 41) $Button3 = GUICtrlCreateButton("SAVE", 392, 16, 57, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ProcessClose($Input1) ; to close external software Exit Case $Button1 $MyFile = FileOpenDialog('Please choose file', '', 'All files (*.*)', 1) GUICtrlSetData($Input1, $MyFile) Case $Button2 ShellExecute(GUICtrlRead($Input1)) Case $Button3 MsgBox(0,"Message","saved") IniWrite(@ScriptDir & "\Config.ini", "Path", "soft", GUICtrlRead($Input1)) EndSwitch ; to disable START Button when external software is exsist If NOT ProcessExists($Input1) AND BitAND(GUICtrlGetState($Button1), $gui_disable) = $gui_disable Then GUICtrlSetState($Button1, $gui_enable) EndIf WEnd
  6. thank you very much for your help... i have tried like this below.. on the save button, I want to be when it was closed and then opened again it will automatically appear paths that have been stored earlier.. is there any other way that is much easier to run the save button?? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $readpath = IniRead(@ScriptDir & "\Config.ini","Path", "soft", "NotFound") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 463, 138, 298, 267) $Input1 = GUICtrlCreateInput($readpath, 56, 16, 265, 21) $Button1 = GUICtrlCreateButton("LOAD", 336, 16, 49, 25) $Button2 = GUICtrlCreateButton("START", 184, 64, 105, 41) $Button3 = GUICtrlCreateButton("SAVE", 392, 16, 57, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $MyFile = FileOpenDialog('Please choose file', '', 'All files (*.*)', 1) GUICtrlSetData($Input1, $MyFile) Case $Button2 ShellExecute(GUICtrlRead($Input1)) Case $Button3 MsgBox(0,"Message","saved") IniWrite(@ScriptDir & "\Config.ini", "Path", "soft", GUICtrlRead($Input1)) EndSwitch WEnd
  7. Hallo All.... i need help how to create script like this : 1. when i click "LOAD" button will display a dialog open to search external software and then the dirpath will shown 2. When i click "SAVE" button it is automatically saved dirpath 3. last when I click the "START" button it will run the external software from that dirpath Please, can give me example to create script? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 463, 138, 298, 267) $Input1 = GUICtrlCreateInput("Input1", 56, 16, 265, 21) $Button1 = GUICtrlCreateButton("LOAD", 336, 16, 49, 25) $Button2 = GUICtrlCreateButton("START", 184, 64, 105, 41) $Button3 = GUICtrlCreateButton("SAVE", 392, 16, 57, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  8. Hello all.. how about this, when the start button is clicked it will display the password, and if the password does not match then it can not run notepad. 1. 2. can help me how to correct my scrip: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 211, 100, 953, 253) $Button1 = GUICtrlCreateButton("START", 48, 32, 105, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ;star() #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Password Dialog", 251, 100, -1, -1) $PasswordEdit = GUICtrlCreateInput("password", 8, 32, 233, 21) $ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, $BS_NOTIFY) $ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, $BS_NOTIFY) $EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;if password correct will run this: run("notepad.exe") EndSwitch WEnd
  9. thank you for your help... it turns out that less is : GUICtrlSetData($inputhost,$readhost) GUICtrlSetData($inputporthost,$readporthost) GUICtrlSetData($inputusername,$readusername) GUICtrlSetData($inputpassword,$readpassword) GUICtrlSetData($inputproxy,$readproxy) but I am still curious about how to use the FileOpenDialog and FileSaveDialog in case like this, if without radiobuttons
  10. i have tried like this scrip below...how to fix it button load and use file open dialog? when click button load will appear data in inputbox #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $readproxy Global $readportproxy Global $readhost Global $readporthost Global $readusername Global $readpassword #Region ### START Koda GUI section ### $formdata = GUICreate("data", 350, 280, 200, 114) GUISetBkColor(0xC0DCC0) $server = GUICtrlCreateGroup("Server", 8, 8, 225, 97) $inputhost = GUICtrlCreateInput($readhost, 88, 32, 137, 21) $Label1 = GUICtrlCreateLabel("Host", 24, 32, 26, 17) $Label2 = GUICtrlCreateLabel("Port", 24, 64, 23, 17) $inputporthost = GUICtrlCreateInput($readporthost, 88, 64, 137, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group1 = GUICtrlCreateGroup("User", 8, 112, 225, 97) $Label3 = GUICtrlCreateLabel("Username", 24, 136, 52, 17) $inputusername = GUICtrlCreateInput($readusername, 88, 136, 137, 21) $Label4 = GUICtrlCreateLabel("Password", 24, 168, 50, 17) $inputpassword = GUICtrlCreateInput($readpassword, 88, 168, 137, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Proxy", 8, 216, 225, 49) $inputproxy = GUICtrlCreateInput("127.0.0.1", 88, 232, 137, 21) $Label5 = GUICtrlCreateLabel("Proxy", 16, 232, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $btnsimpan = GUICtrlCreateButton("SIMPAN", 248, 240, 89, 25) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $btnload = GUICtrlCreateButton("LOAD", 248, 200, 89, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Group3 = GUICtrlCreateGroup("Akun", 248, 8, 89, 177) $AkunRadio1 = GUICtrlCreateRadio("Akun1", 256, 32, 65, 17) $AkunRadio2 = GUICtrlCreateRadio("Akun2", 256, 56, 65, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnsimpan save() Case $btnload load() EndSwitch WEnd Func save() If GUICtrlRead($AkunRadio1) = $gui_checked Then ;jika diklik radio button1 mka akan tersimpan di file config.ini IniWrite(@ScriptDir & "\Config.ini", "Data", "Host", GUICtrlRead($inputhost)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Port Host", GUICtrlRead($inputporthost)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Proxy", GUICtrlRead($inputproxy)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Username", GUICtrlRead($inputusername)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Password", GUICtrlRead($inputpassword)) EndIf If GUICtrlRead($AkunRadio2) = $gui_checked Then ;;jika diklik radio button2 mka akan tersimpan di file config2.ini IniWrite(@ScriptDir & "\Config2.ini", "Data", "Host", GUICtrlRead($inputhost)) IniWrite(@ScriptDir & "\Config2.ini", "Data", "Port Host", GUICtrlRead($inputporthost)) IniWrite(@ScriptDir & "\Config2.ini", "Data", "Proxy", GUICtrlRead($inputproxy)) IniWrite(@ScriptDir & "\Config2.ini", "Data", "Username", GUICtrlRead($inputusername)) IniWrite(@ScriptDir & "\Config2.ini", "Data", "Password", GUICtrlRead($inputpassword)) EndIf EndFunc Func load() If GUICtrlRead($AkunRadio1) = $gui_checked Then $readproxy = IniRead(@ScriptDir & "\Config.ini", "Data", "Proxy", "NotFound") $readhost = IniRead(@ScriptDir & "\Config.ini", "Data", "Host", "NotFound") $readporthost = IniRead(@ScriptDir & "\Config.ini", "Data", "Port Host", "NotFound") $readusername = IniRead(@ScriptDir & "\Config.ini", "Data", "Username", "NotFound") $readpassword = IniRead(@ScriptDir & "\Config.ini", "Data", "Password", "NotFound") EndIf If GUICtrlRead($AkunRadio2) = $gui_checked Then $readproxy = IniRead(@ScriptDir & "\Config2.ini", "Data", "Proxy", "NotFound") $readhost = IniRead(@ScriptDir & "\Config2.ini", "Data", "Host", "NotFound") $readporthost = IniRead(@ScriptDir & "\Config2.ini", "Data", "Port Host", "NotFound") $readusername = IniRead(@ScriptDir & "\Config2.ini", "Data", "Username", "NotFound") $readpassword = IniRead(@ScriptDir & "\Config2.ini", "Data", "Password", "NotFound") EndIf EndFunc
  11. thanks for the suggestion, but I want to save the file more than one file as shown below for example : 1. 2. when the load file "1.ini" it will show the data in a form that has been stored previously 3. 4. when the load file '2.ini" it will show the data in a form that has been stored previously 5.
  12. how to bring it in inputbox automatically when file select? can give me example?
  13. hello all..... how to create script when I click the "SAVE" button it will be saved in format ".ini " as sample : config.ini ; config2.ini etc and if i click the "LOAD" button, it will look for the file load ".ini" so that it appears in GUI.. if click Save Button will appear and if click Load Button will appear can give me example please? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 395, 172, 192, 114) $inputhost = GUICtrlCreateInput("Input1", 96, 32, 145, 21) $Label1 = GUICtrlCreateLabel("Host", 32, 32, 26, 17) $inputusername = GUICtrlCreateInput("Input2", 96, 64, 145, 21) $Label2 = GUICtrlCreateLabel("Username", 32, 72, 52, 17) $inputpassword = GUICtrlCreateInput("Input3", 96, 96, 145, 21) $Label3 = GUICtrlCreateLabel("Password", 32, 104, 50, 17) $btnsave = GUICtrlCreateButton("SAVE", 280, 48, 73, 25) $btnload = GUICtrlCreateButton("LOAD", 280, 88, 73, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnsave IniWrite(@ScriptDir & "\Config.ini", "Data", "Host", GUICtrlRead($inputhost)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Username", GUICtrlRead($inputusername)) IniWrite(@ScriptDir & "\Config.ini", "Data", "Password", GUICtrlRead($inputpassword)) Case $btnload EndSwitch WEnd
×
×
  • Create New...