PDA

View Full Version : How do I script a printer change - <Network> printer name has spaces in it??



ILoveMadoka
29th Dec 2010, 03:53 pm
I have three network printers that I print to for various reasons.
I want to write a script that goes through the printer setup
for each printer but when it gets to the printer name it always bombs out
because the printer name has spaces in it.

Some of the printer paths have standard network names too including backslashes
ie: \\Server1\HP (file://\\Server1\HP) 5000

Changing the printer name is not an option. :(

Even the paper size has spaces "11 x 17" so that is also a problem.
I use Tabloid if it is an option but one printer there is only 11 x 17!

Can someone please tell me how to use text in a script if there are spaces?

Thanks!!

Cat
2nd Jan 2011, 03:15 am
This is a script I wrote to plot 11 x 17 for the network printer we use. The server info is setup with the printer so there was no need to specify the server.

-PLOT
YES
YOUR PRINTER NAME HERE
11" x 17"
INCHES
LANDSCAPE
NO
EXTENTS
FIT
CENTER
YES
Monochrome.ctb
YES
NO
NO
YES
QUIT
YES

ILoveMadoka
3rd Jan 2011, 08:59 pm
That works fine if your printer name doesn't have spaces or backslashes.
As soon as my script gets to a space or backslash it crashes...

Still need help!

Cat
4th Jan 2011, 02:19 am
Sorry, I've used Printer names that contained spaces without any issues and as far as the server names are concerned, ours are set up with the printer so we don't have to specify the server in our scripts. Good Luck.

ILoveMadoka
4th Jan 2011, 08:14 pm
Ok... I'm 'tupid!

Found my problem was that a specific tab name was being referenced
but the screen dump showed the printer name for some reason.

Thanks guys!!