Sign in to follow this  
Followers 0
ajarduini

Copy Installed Printers to Notepad

6 posts in this topic

Greetings everyone,

I am in the process of creating a script that migrates a local users profile to a network share so their data can easily to moved to a new computer.

I am in the middle of creating a notes section that I would like to capture the users network drive mappings and "send" them to notepad and capture the currently installed printer names and "send" them to the same notepad.

I was already able to script the network drive portion and it works perfect, but I fear I need some assistance with capturing the printer names as I am not able to find to much documentation on this topic online.

Any suggestions and/or help is greatly appreciated.

Thank you,

Tony

Share this post


Link to post
Share on other sites



Look at WMI & Win32_Printer, this is an example quickly created using the modified version of Scriptomatic by GEOSoft.

; Generated by AutoIt Scriptomatic September 07, 2011

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output &= "Computer: " & $strComputer & @CRLF
$Output &= "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
For $objItem In $colItems
$Output &= "Attributes: " & $objItem.Attributes & @CRLF
$Output &= "Availability: " & $objItem.Availability & @CRLF
$strAvailableJobSheets = $objItem.AvailableJobSheets(0)
$Output &= "AvailableJobSheets: " & $strAvailableJobSheets & @CRLF
$Output &= "AveragePagesPerMinute: " & $objItem.AveragePagesPerMinute & @CRLF
$strCapabilities = $objItem.Capabilities(0)
$Output &= "Capabilities: " & $strCapabilities & @CRLF
$strCapabilityDescriptions = $objItem.CapabilityDescriptions(0)
$Output &= "CapabilityDescriptions: " & $strCapabilityDescriptions & @CRLF
$Output &= "Caption: " & $objItem.Caption & @CRLF
$strCharSetsSupported = $objItem.CharSetsSupported(0)
$Output &= "CharSetsSupported: " & $strCharSetsSupported & @CRLF
$Output &= "Comment: " & $objItem.Comment & @CRLF
$Output &= "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF
$Output &= "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF
$Output &= "CreationClassName: " & $objItem.CreationClassName & @CRLF
$strCurrentCapabilities = $objItem.CurrentCapabilities(0)
$Output &= "CurrentCapabilities: " & $strCurrentCapabilities & @CRLF
$Output &= "CurrentCharSet: " & $objItem.CurrentCharSet & @CRLF
$Output &= "CurrentLanguage: " & $objItem.CurrentLanguage & @CRLF
$Output &= "CurrentMimeType: " & $objItem.CurrentMimeType & @CRLF
$Output &= "CurrentNaturalLanguage: " & $objItem.CurrentNaturalLanguage & @CRLF
$Output &= "CurrentPaperType: " & $objItem.CurrentPaperType & @CRLF
$Output &= "Default: " & $objItem.Default & @CRLF
$strDefaultCapabilities = $objItem.DefaultCapabilities(0)
$Output &= "DefaultCapabilities: " & $strDefaultCapabilities & @CRLF
$Output &= "DefaultCopies: " & $objItem.DefaultCopies & @CRLF
$Output &= "DefaultLanguage: " & $objItem.DefaultLanguage & @CRLF
$Output &= "DefaultMimeType: " & $objItem.DefaultMimeType & @CRLF
$Output &= "DefaultNumberUp: " & $objItem.DefaultNumberUp & @CRLF
$Output &= "DefaultPaperType: " & $objItem.DefaultPaperType & @CRLF
$Output &= "DefaultPriority: " & $objItem.DefaultPriority & @CRLF
$Output &= "Description: " & $objItem.Description & @CRLF
$Output &= "DetectedErrorState: " & $objItem.DetectedErrorState & @CRLF
$Output &= "DeviceID: " & $objItem.DeviceID & @CRLF
$Output &= "Direct: " & $objItem.Direct & @CRLF
$Output &= "DoCompleteFirst: " & $objItem.DoCompleteFirst & @CRLF
$Output &= "DriverName: " & $objItem.DriverName & @CRLF
$Output &= "EnableBIDI: " & $objItem.EnableBIDI & @CRLF
$Output &= "EnableDevQueryPrint: " & $objItem.EnableDevQueryPrint & @CRLF
$Output &= "ErrorCleared: " & $objItem.ErrorCleared & @CRLF
$Output &= "ErrorDescription: " & $objItem.ErrorDescription & @CRLF
$strErrorInformation = $objItem.ErrorInformation(0)
$Output &= "ErrorInformation: " & $strErrorInformation & @CRLF
$Output &= "ExtendedDetectedErrorState: " & $objItem.ExtendedDetectedErrorState & @CRLF
$Output &= "ExtendedPrinterStatus: " & $objItem.ExtendedPrinterStatus & @CRLF
$Output &= "Hidden: " & $objItem.Hidden & @CRLF
$Output &= "HorizontalResolution: " & $objItem.HorizontalResolution & @CRLF
$Output &= "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
$Output &= "JobCountSinceLastReset: " & $objItem.JobCountSinceLastReset & @CRLF
$Output &= "KeepPrintedJobs: " & $objItem.KeepPrintedJobs & @CRLF
$strLanguagesSupported = $objItem.LanguagesSupported(0)
$Output &= "LanguagesSupported: " & $strLanguagesSupported & @CRLF
$Output &= "LastErrorCode: " & $objItem.LastErrorCode & @CRLF
$Output &= "Local: " & $objItem.Local & @CRLF
$Output &= "Location: " & $objItem.Location & @CRLF
$Output &= "MarkingTechnology: " & $objItem.MarkingTechnology & @CRLF
$Output &= "MaxCopies: " & $objItem.MaxCopies & @CRLF
$Output &= "MaxNumberUp: " & $objItem.MaxNumberUp & @CRLF
$Output &= "MaxSizeSupported: " & $objItem.MaxSizeSupported & @CRLF
$strMimeTypesSupported = $objItem.MimeTypesSupported(0)
$Output &= "MimeTypesSupported: " & $strMimeTypesSupported & @CRLF
$Output &= "Name: " & $objItem.Name & @CRLF
$strNaturalLanguagesSupported = $objItem.NaturalLanguagesSupported(0)
$Output &= "NaturalLanguagesSupported: " & $strNaturalLanguagesSupported & @CRLF
$Output &= "Network: " & $objItem.Network & @CRLF
$strPaperSizesSupported = $objItem.PaperSizesSupported(0)
$Output &= "PaperSizesSupported: " & $strPaperSizesSupported & @CRLF
$strPaperTypesAvailable = $objItem.PaperTypesAvailable(0)
$Output &= "PaperTypesAvailable: " & $strPaperTypesAvailable & @CRLF
$Output &= "Parameters: " & $objItem.Parameters & @CRLF
$Output &= "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF
$Output &= "PortName: " & $objItem.PortName & @CRLF
$strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
$Output &= "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF
$Output &= "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF
$strPrinterPaperNames = $objItem.PrinterPaperNames(0)
$Output &= "PrinterPaperNames: " & $strPrinterPaperNames & @CRLF
$Output &= "PrinterState: " & $objItem.PrinterState & @CRLF
$Output &= "PrinterStatus: " & $objItem.PrinterStatus & @CRLF
$Output &= "PrintJobDataType: " & $objItem.PrintJobDataType & @CRLF
$Output &= "PrintProcessor: " & $objItem.PrintProcessor & @CRLF
$Output &= "Priority: " & $objItem.Priority & @CRLF
$Output &= "Published: " & $objItem.Published & @CRLF
$Output &= "Queued: " & $objItem.Queued & @CRLF
$Output &= "RawOnly: " & $objItem.RawOnly & @CRLF
$Output &= "SeparatorFile: " & $objItem.SeparatorFile & @CRLF
$Output &= "ServerName: " & $objItem.ServerName & @CRLF
$Output &= "Shared: " & $objItem.Shared & @CRLF
$Output &= "ShareName: " & $objItem.ShareName & @CRLF
$Output &= "SpoolEnabled: " & $objItem.SpoolEnabled & @CRLF
$Output &= "StartTime: " & WMIDateStringToDate($objItem.StartTime) & @CRLF
$Output &= "Status: " & $objItem.Status & @CRLF
$Output &= "StatusInfo: " & $objItem.StatusInfo & @CRLF
$Output &= "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF
$Output &= "SystemName: " & $objItem.SystemName & @CRLF
$Output &= "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & @CRLF
$Output &= "UntilTime: " & WMIDateStringToDate($objItem.UntilTime) & @CRLF
$Output &= "VerticalResolution: " & $objItem.VerticalResolution & @CRLF
$Output &= "WorkOffline: " & $objItem.WorkOffline & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Printer" )
Endif


Func WMIDateStringToDate($dtmDate)

Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Greetings everyone,

I am in the process of creating a script that migrates a local users profile to a network share so their data can easily to moved to a new computer.

I am in the middle of creating a notes section that I would like to capture the users network drive mappings and "send" them to notepad and capture the currently installed printer names and "send" them to the same notepad.

I was already able to script the network drive portion and it works perfect, but I fear I need some assistance with capturing the printer names as I am not able to find to much documentation on this topic online.

Any suggestions and/or help is greatly appreciated.

Thank you,

Tony

Check out scriptomatic for how to easily retrieve hardware information using WMI...

Specifically investigate the Win32_Printer* WMI classes.

In the Output group box, you can choose "Text", which shows how to output text to a text file. A much cleaner way to achieve your aims rather than using Send.

D

[EDIT] Guinness beat me to it, but anyway... here's the code to output the info to a text file...

; Generated by AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $Output & "Attributes: " & $objItem.Attributes & @CRLF
      $Output = $Output & "Availability: " & $objItem.Availability & @CRLF
      $strAvailableJobSheets = $objItem.AvailableJobSheets(0)
      $Output = $Output & "AvailableJobSheets: " & $strAvailableJobSheets & @CRLF
      $Output = $Output & "AveragePagesPerMinute: " & $objItem.AveragePagesPerMinute & @CRLF
      $strCapabilities = $objItem.Capabilities(0)
      $Output = $Output & "Capabilities: " & $strCapabilities & @CRLF
      $strCapabilityDescriptions = $objItem.CapabilityDescriptions(0)
      $Output = $Output & "CapabilityDescriptions: " & $strCapabilityDescriptions & @CRLF
      $Output = $Output & "Caption: " & $objItem.Caption & @CRLF
      $strCharSetsSupported = $objItem.CharSetsSupported(0)
      $Output = $Output & "CharSetsSupported: " & $strCharSetsSupported & @CRLF
      $Output = $Output & "Comment: " & $objItem.Comment & @CRLF
      $Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF
      $Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF
      $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF
      $strCurrentCapabilities = $objItem.CurrentCapabilities(0)
      $Output = $Output & "CurrentCapabilities: " & $strCurrentCapabilities & @CRLF
      $Output = $Output & "CurrentCharSet: " & $objItem.CurrentCharSet & @CRLF
      $Output = $Output & "CurrentLanguage: " & $objItem.CurrentLanguage & @CRLF
      $Output = $Output & "CurrentMimeType: " & $objItem.CurrentMimeType & @CRLF
      $Output = $Output & "CurrentNaturalLanguage: " & $objItem.CurrentNaturalLanguage & @CRLF
      $Output = $Output & "CurrentPaperType: " & $objItem.CurrentPaperType & @CRLF
      $Output = $Output & "Default: " & $objItem.Default & @CRLF
      $strDefaultCapabilities = $objItem.DefaultCapabilities(0)
      $Output = $Output & "DefaultCapabilities: " & $strDefaultCapabilities & @CRLF
      $Output = $Output & "DefaultCopies: " & $objItem.DefaultCopies & @CRLF
      $Output = $Output & "DefaultLanguage: " & $objItem.DefaultLanguage & @CRLF
      $Output = $Output & "DefaultMimeType: " & $objItem.DefaultMimeType & @CRLF
      $Output = $Output & "DefaultNumberUp: " & $objItem.DefaultNumberUp & @CRLF
      $Output = $Output & "DefaultPaperType: " & $objItem.DefaultPaperType & @CRLF
      $Output = $Output & "DefaultPriority: " & $objItem.DefaultPriority & @CRLF
      $Output = $Output & "Description: " & $objItem.Description & @CRLF
      $Output = $Output & "DetectedErrorState: " & $objItem.DetectedErrorState & @CRLF
      $Output = $Output & "DeviceID: " & $objItem.DeviceID & @CRLF
      $Output = $Output & "Direct: " & $objItem.Direct & @CRLF
      $Output = $Output & "DoCompleteFirst: " & $objItem.DoCompleteFirst & @CRLF
      $Output = $Output & "DriverName: " & $objItem.DriverName & @CRLF
      $Output = $Output & "EnableBIDI: " & $objItem.EnableBIDI & @CRLF
      $Output = $Output & "EnableDevQueryPrint: " & $objItem.EnableDevQueryPrint & @CRLF
      $Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & @CRLF
      $Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & @CRLF
      $strErrorInformation = $objItem.ErrorInformation(0)
      $Output = $Output & "ErrorInformation: " & $strErrorInformation & @CRLF
      $Output = $Output & "ExtendedDetectedErrorState: " & $objItem.ExtendedDetectedErrorState & @CRLF
      $Output = $Output & "ExtendedPrinterStatus: " & $objItem.ExtendedPrinterStatus & @CRLF
      $Output = $Output & "Hidden: " & $objItem.Hidden & @CRLF
      $Output = $Output & "HorizontalResolution: " & $objItem.HorizontalResolution & @CRLF
      $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
      $Output = $Output & "JobCountSinceLastReset: " & $objItem.JobCountSinceLastReset & @CRLF
      $Output = $Output & "KeepPrintedJobs: " & $objItem.KeepPrintedJobs & @CRLF
      $strLanguagesSupported = $objItem.LanguagesSupported(0)
      $Output = $Output & "LanguagesSupported: " & $strLanguagesSupported & @CRLF
      $Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & @CRLF
      $Output = $Output & "Local: " & $objItem.Local & @CRLF
      $Output = $Output & "Location: " & $objItem.Location & @CRLF
      $Output = $Output & "MarkingTechnology: " & $objItem.MarkingTechnology & @CRLF
      $Output = $Output & "MaxCopies: " & $objItem.MaxCopies & @CRLF
      $Output = $Output & "MaxNumberUp: " & $objItem.MaxNumberUp & @CRLF
      $Output = $Output & "MaxSizeSupported: " & $objItem.MaxSizeSupported & @CRLF
      $strMimeTypesSupported = $objItem.MimeTypesSupported(0)
      $Output = $Output & "MimeTypesSupported: " & $strMimeTypesSupported & @CRLF
      $Output = $Output & "Name: " & $objItem.Name & @CRLF
      $strNaturalLanguagesSupported = $objItem.NaturalLanguagesSupported(0)
      $Output = $Output & "NaturalLanguagesSupported: " & $strNaturalLanguagesSupported & @CRLF
      $Output = $Output & "Network: " & $objItem.Network & @CRLF
      $strPaperSizesSupported = $objItem.PaperSizesSupported(0)
      $Output = $Output & "PaperSizesSupported: " & $strPaperSizesSupported & @CRLF
      $strPaperTypesAvailable = $objItem.PaperTypesAvailable(0)
      $Output = $Output & "PaperTypesAvailable: " & $strPaperTypesAvailable & @CRLF
      $Output = $Output & "Parameters: " & $objItem.Parameters & @CRLF
      $Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF
      $Output = $Output & "PortName: " & $objItem.PortName & @CRLF
      $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
      $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF
      $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF
      $strPrinterPaperNames = $objItem.PrinterPaperNames(0)
      $Output = $Output & "PrinterPaperNames: " & $strPrinterPaperNames & @CRLF
      $Output = $Output & "PrinterState: " & $objItem.PrinterState & @CRLF
      $Output = $Output & "PrinterStatus: " & $objItem.PrinterStatus & @CRLF
      $Output = $Output & "PrintJobDataType: " & $objItem.PrintJobDataType & @CRLF
      $Output = $Output & "PrintProcessor: " & $objItem.PrintProcessor & @CRLF
      $Output = $Output & "Priority: " & $objItem.Priority & @CRLF
      $Output = $Output & "Published: " & $objItem.Published & @CRLF
      $Output = $Output & "Queued: " & $objItem.Queued & @CRLF
      $Output = $Output & "RawOnly: " & $objItem.RawOnly & @CRLF
      $Output = $Output & "SeparatorFile: " & $objItem.SeparatorFile & @CRLF
      $Output = $Output & "ServerName: " & $objItem.ServerName & @CRLF
      $Output = $Output & "Shared: " & $objItem.Shared & @CRLF
      $Output = $Output & "ShareName: " & $objItem.ShareName & @CRLF
      $Output = $Output & "SpoolEnabled: " & $objItem.SpoolEnabled & @CRLF
      $Output = $Output & "StartTime: " & WMIDateStringToDate($objItem.StartTime) & @CRLF
      $Output = $Output & "Status: " & $objItem.Status & @CRLF
      $Output = $Output & "StatusInfo: " & $objItem.StatusInfo & @CRLF
      $Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF
      $Output = $Output & "SystemName: " & $objItem.SystemName & @CRLF
      $Output = $Output & "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & @CRLF
      $Output = $Output & "UntilTime: " & WMIDateStringToDate($objItem.UntilTime) & @CRLF
      $Output = $Output & "VerticalResolution: " & $objItem.VerticalResolution & @CRLF
      $Output = $Output & "WorkOffline: " & $objItem.WorkOffline & @CRLF
   Next
   ConsoleWrite($Output)
   FileWrite(@TempDir & "\Win32_Printer.TXT", $Output )
   Run(@Comspec & " /c start " & @TempDir & "\Win32_Printer.TXT" )
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Printer" )
Endif

Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc
Edited by RagsRevenge

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#include "CompInfo.au3" ;If you are wanting to pull WMI data from different computers then Declare $cI_CompName as the computer name before the include.

#region -- Printers
;NOTE: Printers contains alot of information, and may require a different output format.
Dim $Print
_ComputerGetPrinters($Print)
If @error Then
$error = @error
$extended = @extended
Switch $extended
  Case 1
   _ErrorMsg($ERR_NO_INFO)
  Case 2
   _ErrorMsg($ERR_NOT_OBJ)
EndSwitch
EndIf
For $i = 1 To $Print[0][0] Step 1
MsgBox(0, "Test _ComputerGetPrinters", "Name: " & $Print[$i][0] )
Next
#endregion Printers

please look at the UDF

Is this helps you?

This example is taken from JSThePatriot.

Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

Perfect crew! I really thank you for your help and support. Between your suggested scripts I was able to customize the code and have it output what I need.

You guys (or gals) are great!

Thanks again.

Share this post


Link to post
Share on other sites

Another one is in WinAPIEx.au3 by Yashied (search the forum) look for the function _WinAPI_GetDefaultPrinter()


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0