Jump to content

Lantz

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Lantz

  1. I am looking to retrieve some information about the Public key services stored in the Configuration Context, but for the life of me I can figure out how to mange that context with this UDF. To clarify i want be able to read the caCertificate attribute of: CN=domain-CA,CN=AIA,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=local
  2. That seems to solve the problem!! Thanks for helping out.
  3. I am working on a script that is gonna ease the domain migration of 100+ computers, one of the steps in the script is to create a local account and add it to the local administrators group. This all works fine on my test machine running english windows, but on a Swedish OS where the Administrator group is called "Administratörer" it doesnt find the group because it misinterprets the letter Ö. Here is a short script demonstrating the same problem but when adding a user with Ö in the name. The result will be a user called "tempadmin÷" #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #include <Constants.au3> #include <MsgBoxConstants.au3> $RunPid=Run(@ComSpec & ' /K', '',"",$STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD) Sleep(1500) StdinWrite($RunPid, 'Net User ' & "tempadminö" & ' ' & "secretpassword" & ' /add' & @CRLF) Sleep(2000) $result=StdoutRead($RunPid) StdinWrite($RunPid) ProcessClose($RunPid) MsgBox(4096,"test",$result) I have tried playing around with chcp and cmd /U, cmd /A but haven't really gotten any where, is there anyone that can nudge me in the right direction? FYI: to my knowledge this script must be compiled and then run as admin before it will create any user.
  4. I though maybe this time i will be fast enough to figure out the problem for my self before you do, but I guess you cant beat a dragon The idea to place the "task" in a function had accrued to me, but honestly I wanted to figure out/learn away to do it this way instead to see if it was possible.
  5. Solved my own problem, it´s debatable if its the best solution but certainly good enough for me: GUICtrlSendMsg($RunCommands[11][2],$BM_CLICK,0,0) This simulates a button click on button $RunCommands[11][2]
  6. I have tried using controlclick but i am reluctant to use any command that references the title of the window as that might change in the future. I have tried passing the handles of the window and the handle of the button to controlclick without success. ControlClick($RunCommands[0][2],"",$RunCommands[11][2])
  7. Hey! What is the best way to simulate clicking a button within your own gui? Background: I have two buttons next and previous, when clicked they increment or decrease an integer variable that is then used to tell a different part of the program what page to display. But to update and show the new display I currently manually have to click a button.
  8. True, bad example.
  9. I must confess i am not quite sure what this can of worm entails, I guess I am not really active enough on the forum to keep up with current events. You can have all my worms if you implement GUICtrlSwitch() Non the less for any other user with the same problem a simple and valid work around would be: $LabelID=GUICtrlCreateLabel("my disable label", 10, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateButton("my button", 50, 50) GUICtrlSetState(-1, $GUI_FOCUS) local $currentID=$LabelID GUICtrlSetState($currentID, $GUI_ENABLE) ;This command would now edit the state of the lable instead of the button
  10. Undocumented yet documented in pretty much all helpfiles where it´s applicable? Thanks for the info and quick reply. I´m normally more a hardware/technical guy with no programming education but AutoIT lets me easily do fairly powerful software development, quickly. I´m eternal grateful for this tool and all people keeping it alive!
  11. Pretty much all GUI command functions lets you use -1 as a ControlID to edit/reference the last created Controll. Is there away to say that from now and until further notice -1 will reference ControlID 2 instead of the last created controll. For example $LabelID=GUICtrlCreateLabel("my disable label", 10, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateButton("my button", 50, 50) GUICtrlSetState(-1, $GUI_FOCUS) GUICtrlSwitch($LabelID);This command would make it so that -1 referenced the controll ID $LabelID GUICtrlSetState(-1, $GUI_ENABLE) ;This command would now edit the state of the lable instead of the button In short i am looking for the GUISwitch function for Control objects.
  12. Including the main script in the sub script? The idea had crossed my mind but i was hoping there was a neater way to do it. What is your general tip for situations like this, where you need multiple subscripts to do the same functions. Simply putting the needed function in all subscripts? Making one subscript that has all shared functions and including it in all subscripts? Something more clever?
  13. Hi! lets say i have my main script main.au3, that among other things contains this: #include<subscript.au3> func logg($TextToLog) FileWrite("log.txt", $TextToLog) EndFunc Is there anyway that a function located in subscript.au3 can run the logg function from main.au3?
×
×
  • Create New...