joeybales Posted April 22, 2014 Share Posted April 22, 2014 I'm having trouble with a script for installing printers on Windows 7. I'm using AutoIT 3.3.10.2, but have also replicated this issue on Windows 8 with AutoIT versions 3.3.10.2 and 3.3.8.1. When I attempt setting the text in a specific Edit box (Edit2 in this case), it also sets the text in the text box Edit3. See my example code below. I can easily set the text for Edit3 and it does not affect Edit2. Am I doing something wrong or is this a bug in AutoIT or Windows? I've tried searching for this problem, but have been unable to find anything because my search terms have been so generic. Any help would be greatly appreciated. I've added a sleep and commented out the Edit3 line to make the issue obvious. The problematic code is at line 15. ; Run the Add Printer Wizard Run(@ComSpec & " /c " & 'rundll32 printui.dll,PrintUIEntry /il', "",@SW_HIDE) ; Wait for the window and get handle, move through dialogs Local $hPrtWnd = WinWait("Add Printer", "Add a net&work, wireless or Bluetooth printer") ControlClick($hPrtWnd, "Add a net&work, wireless or Bluetooth printer", "[CLASSNN:Button6]", "left") WinWait($hPrtWnd, "The p&rinter that I want isn't listed") ControlClick($hPrtWnd, "The p&rinter that I want isn't listed", "[CLASSNN:Button8]", "left") WinWait($hPrtWnd, "Add a printer using a TCP/&IP address or hostname") ControlClick($hPrtWnd, "Add a printer using a TCP/&IP address or hostname", "[CLASSNN:Button11]", "left") ControlClick($hPrtWnd, "Add a printer using a TCP/&IP address or hostname", "[CLASSNN:Button1]", "left") ; Enter data ControlCommand($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:ComboBox1]", "SelectString", "Autodetect") ControlSetText($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Edit2]", "192.168.1.201") Sleep(10000) ;ControlSetText($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Edit3]", "27001") ControlCommand($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button14]", "Check") ControlClick($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button1]", "left") ; title "Error" ; text "Error loading the Tcp Mib library." WinWait("Error", "Error loading the Tcp Mib library.") ControlClick("Error", "Error loading the Tcp Mib library.", "[CLASSNN:Button1]", "left") WinWait("[CLASS:#32770]") ControlClick("[CLASS:#32770]", "", "[CLASSNN:Button1]", "left") ControlClick($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button3]", "left") Link to comment Share on other sites More sharing options...
Solution FireFox Posted April 22, 2014 Solution Share Posted April 22, 2014 The thing is : it's the same in manual mode. Link to comment Share on other sites More sharing options...
joeybales Posted April 22, 2014 Author Share Posted April 22, 2014 The thing is : it's the same in manual mode. What is manual mode? Link to comment Share on other sites More sharing options...
FireFox Posted April 22, 2014 Share Posted April 22, 2014 When you (the human) type in the edit. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2014 Moderators Share Posted April 22, 2014 joeybales,I understand FireFox to be saying that the same thing happens when entering the text manually via the keyboard - which is what indeed what I see on my Win7 machine when I access that dialog. It looks like a Windows problem - nothing to do with AutoIt. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jguinch Posted April 22, 2014 Share Posted April 22, 2014 Have a look at my >Printers management with WMI functions,it could help you. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now