gcue Posted August 4, 2008 Posted August 4, 2008 (edited) i am trying to list printers that are installed locally and not manage via network queues how can i get this into an arraydisplay type of display? #include <"array.au3"> For $i = 1 To 20 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers", $i) If @error <> 0 Then ExitLoop $printer_name = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Name") $printer_port = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Port") If Not StringInStr($printer_port, "ipp://") Then MsgBox(0, "", $printer_name) EndIf Next Edited August 4, 2008 by gcue
PsaltyDS Posted August 4, 2008 Posted August 4, 2008 i am trying to list printers that are installed locally and not manage via network queues how can i get this into an arraydisplay type of display? #include <"array.au3"> For $i = 1 To 20 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers", $i) If @error <> 0 Then ExitLoop $printer_name = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Name") $printer_port = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Port") If Not StringInStr($printer_port, "ipp://") Then MsgBox(0, "", $printer_name) EndIf Next With _ArrayAdd(), like so: #include <Array.au3> Global $avKeys[1] = [0] Global $i = 1 While 1 $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers", $i) If @error <> 0 Then ExitLoop $printer_name = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Name") $printer_port = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\windows nt\currentversion\print\printers\" & $var, "Port") If Not StringInStr($printer_port, "ipp://") Then _ArrayAdd($avKeys, $printer_name) $i += 1 WEnd $avKeys[0] = UBound($avKeys) - 1 _ArrayDisplay($avKeys, "$avKeys") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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