Here is a quick code snippet to determine if a printer is installed on a Microsoft Windows system;
MsgBox printerExists("Microsoft XPS Document Writer")
printerExists = False
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter In colPrinters
If objPrinter.Name = str Then
printerExists = True
Lets say you have some program ‘A’ that has no documentation and no help files but is being executed by some program ‘B’. You want to run program ‘A’ is individually, but you need to know what parameters/arguments are being passed from program ‘B’.
The following executable will help. Replace program ‘A’ (temporarily) with the following executable. Once program ‘B’ executes this new program, the parameters will be displayed in a message box.
Source code below;
Public Sub main()
Dim msg As String = vbNullString
Dim separators As String = " "
Dim commands As String = Microsoft.VisualBasic.Command()
Dim str() As String = commands.Split(separators.ToCharArray)
Dim i As Long
For i = 0 To UBound(str)
msg = msg & str(i).ToString & vbCr