Adding HTTP Printer with Script in XP

Peter_Story

Distinguished
May 26, 2011
3
0
18,510
Hello!

I am writing a script to add network printers on Windows XP. The script is for my school, and will make it easy to add printers managed by our CUPS print server.

This is what I have so far:

Code:
set /p room=What room number (ex. B230) is the printer located in?

rundll32 printui.dll,PrintUIEntry /in /n "http://172.16.28.25:631/printers/%room%" /m "MS Publisher Imagesetter"

echo Room %room% printer installed. Enjoy your new printer!

Here is a list of switches that can be used with RUNDLL32 PRINTUI.DLL,PrintUIEntry.
http://www.robvanderwoude.com/2kprintcontrol.php

I am not sure if my driver syntax is correct – all I know is that the script as a whole doesn't work.
None of the examples for using "printui.dll" use the URL format – that might be a problem, too.

I'm a big UNIX guy, and I'm getting wicked frustrated with Windows – please prove me wrong!

Thanks so much!
-Peter
 

Peter_Story

Distinguished
May 26, 2011
3
0
18,510
Here is exactly what I want done, but with a batch script and with the user's ability to change B230 to A102, etc.

1.bmp

2.bmp

3.bmp

4.bmp


-Peter
 

Peter_Story

Distinguished
May 26, 2011
3
0
18,510
Unfortunately, I never did find a solution.
I'm 99% sure it could be done with PowerShell scripting, but learning PowerShell would be too big a time investment.

I'm off to greener pastures is UNIX land!