Luigi Posted June 16, 2015 Share Posted June 16, 2015 (edited) Hi forum, is possible get/catch all name (and IP) of all printers by 'printers properties' in control panel?Thank you Edited June 17, 2015 by Luigi CaptainSparky 1 Visit my repository Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 16, 2015 Share Posted June 16, 2015 I wrote a script that calls the list of printers two different ways. One is using the built in Windows prnmngr.vbs the other is using a UDF called compinfo.expandcollapse popup#include <File.au3> #Include <compinfo.au3> $ThisPC = @ComputerName DirCreate(@DesktopDir & "\Gathered Information\" & $ThisPC) $DeskDriveFile = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\" & @UserName & " Mapped Drives.txt") $DeskPrnFile = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\" & @UserName & " Printers.txt") $DeskPrnFile2 = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\" & @UserName & " Printers2.txt") $DeskStartFile = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\Common Startup.txt") $DeskDesktopFile = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\Common Desktop.txt") $DeskBiosFile = (@DesktopDir & "\Gathered Information\" & $ThisPC & "\SystemBiosInfo.txt") Run(@ComSpec & ' /k net use > ' & '"' & $DeskDriveFile & '"', 'C:\', @SW_HIDE) Run(@ComSpec & ' /k cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -l > ' & '"' & $DeskPrnFile & '"', 'C:\', @SW_HIDE) $StartupAllUsr = _FileListToArray(@StartupCommonDir) _FileWriteFromArray($DeskStartFile, $StartupAllUsr) $DesktopAllUsr = _FileListToArray(@DesktopCommonDir) _FileWriteFromArray($DeskDesktopFile, $DesktopAllUsr) Dim $Print _ComputerGetPrinters($Print) For $i = 1 To $Print[0][0] Step 1 FileWriteLine($DeskPrnFile2,"Name: " & $Print[$i][0] & @CRLF & _ "Description: " & $Print[$i][4] & @CRLF & _ "Comment: " & $Print[$i][9] & @CRLF & _ "DeviceID: " & $Print[$i][28] & @CRLF & _ "DriverName: " & $Print[$i][31] & @CRLF & _ "PortName: " & $Print[$i][59] & @CRLF & _ "ServerName: " & $Print[$i][72] & @CRLF & _ "Shared: " & $Print[$i][73] & @CRLF & _ "ShareName: " & $Print[$i][74] & @CRLF & _ "SystemName: " & $Print[$i][80] & @CRLF & _ "WorkOffline: " & $Print[$i][84] & @CRLF & @CRLF) Next Dim $SystemProduct _ComputerGetSystemProduct($SystemProduct) For $i = 1 To $SystemProduct[0][0] Step 1 FileWriteLine($DeskBiosFile, "Name: " & $SystemProduct[$i][0] & @CRLF & _ "Identifying Number: " & $SystemProduct[$i][1] & @CRLF & _ "SKU Number: " & $SystemProduct[$i][2] & @CRLF & _ "UUID: " & $SystemProduct[$i][3] & @CRLF & _ "Description: " & $SystemProduct[$i][4] & @CRLF & _ "Vendor: " & $SystemProduct[$i][5] & @CRLF & _ "Version: " & $SystemProduct[$i][6]) Next $Final = MsgBox(4, "Black Magic Automation","Information Gathered!, Also Capture Files for Desktop & Startup?") If $Final = 7 Then Exit Else DirCopy(@DesktopCommonDir, @DesktopDir & "\Gathered Information\" & $ThisPC & "\Common Desktop\", 1) DirCopy(@StartupCommonDir, @DesktopDir & "\Gathered Information\" & $ThisPC & "\Common Startup\", 1) EndIf Link to comment Share on other sites More sharing options...
jguinch Posted June 17, 2015 Share Posted June 17, 2015 You can try with my Printers management UDF : https://www.autoitscript.com/forum/topic/155485-printers-management-with-wmi/ Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Luigi Posted June 17, 2015 Author Share Posted June 17, 2015 (edited) ViciusXUSMC, thank you for your reply.jguinch, thanks for your reply too.Forgive-me to not add this information in the post:a] I don't have administratives permission in the machine;b] I have one thousand of printers in gui (above) and net get it...c] not all printers are instaled in the machine, it is a list of all available printers (the list is my target)So sorry for my mistake, if can I run any script, it is very easy... Edited June 17, 2015 by Luigi Visit my repository Link to comment Share on other sites More sharing options...
Bert Posted June 17, 2015 Share Posted June 17, 2015 you may want to look at this:http://www8.hp.com/us/en/solutions/business-solutions/printingsolutions/wja.htmlI used to be a certified HP trainer. This will do what you need. Luigi 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Luigi Posted June 17, 2015 Author Share Posted June 17, 2015 Bert, your tip is (very) interesting. I will study it. Thank you.About the code:I can write this code to get the information:#include <Array.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> If Not WinActive("Propriedades de PrinterName em LANNETWORK") Then WinActivate("Propriedades de PrinterName em LANNETWORK") Global $hGui = WinGetHandle("Propriedades de PrinterName em LANNETWORK") Global $hListView = ControlGetHandle("Propriedades de PrinterName em LANNETWORK", "", "[Class:SysListView32]") ConsoleWrite("$hListView[ " & $hListView & " ]" & @LF) Global $a_list[_GUICtrlListView_GetItemCount($hListView)] For $ii = 0 To _GUICtrlListView_GetItemCount($hListView) - 1 For $jj = 0 To 3 If $jj = 0 Or $jj = 2 Then ConsoleWrite(_GUICtrlListView_GetItemText($hListView, $ii, $jj) & @TAB) Next ConsoleWrite(@LF) Next Visit my repository 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