Getting Printer Information

tjsmith1987

New member
Joined
Dec 3, 2009
Messages
2
Programming Experience
Beginner
Good Aftrenoon

I am new here, but i have been looking everywhere how i can do this to no avail.

I am designing a backup/restore utility for work.
atm i have been able to populate field for PC name, IP address, MAC address, number of printers installed on the PC

but i am wondering is it possble to get all the printer information 'with the click of a button' to print all information like the prnmngr.vbs script down.

I am able to run a batch file but i wanna get it to go from that app or even embed to batch file to the app and run it form there ... can you please help me

Batch File:
cscript c:\windows\system32\prnmngr.vbs -l > c:\printers.txt
notepad /p c:\printers.txt
del c:\printers.txt
 
Using Visual Studio .Net 2003
should this work?
I am not at work, so I am unable to test

Dim txt As New Process
txt.StartInfo.UseShellExecute = True
txt.StartInfo.Arguments = "C:\windows\system32\prnmngr.vbs -l > C:\printer.txt"
txt.StartInfo.FileName = "cscript.exe"
txt.Start()

Dim print As New Process
print.StartInfo.UseShellExecute = True
print.StartInfo.Arguments = "C:\windows\notepad.exe /p c:\printers.txt"
print.StartInfo.FileName = "cscript.exe"
print.Start()
 
No need to use windows api to get info back. Take a look at the PrinterSettings class in the help file. You should be able to retrieve any info you want
 
The example linked to uses PrinterSettings to get the settings related properties (which is not many) and then API for additional printer properties. This can all be retrieved with WMI and Win32_Printer class also.
 
Back
Top