NSFW bat file help

JAXvillain

Curly_Sue
Oct 13, 2004
68,732
1,999
923
Marklar
₥0
I'm making a script to add 3 new copiers on the floor and delete the old 3.

here are the lines I'm using for each action:
rundll32 printui.dll,PrintUIEntry /in /n "\\server\copier"
rundll32 printui.dll,PrintUIEntry /dn /n "\\server\copier"

I had all 3 of the old copiers so the script ran normally. I ran it again when I didn't have any of the old 3 and it had a stop error on each. How do I get it to continue through the error if the copier is not found and proceed to the next one?
 

JAXvillain

Curly_Sue
Oct 13, 2004
68,732
1,999
923
Marklar
₥0
think that got it. thanks man! going to add old queues back and start from the top to double check
 

fly

omg
Oct 1, 2004
76,193
26,088
1,323
Marklar
₥64,206
Steam
mattressfish
I'm making a script to add 3 new copiers on the floor and delete the old 3.

here are the lines I'm using for each action:
rundll32 printui.dll,PrintUIEntry /in /n "\\server\copier"
rundll32 printui.dll,PrintUIEntry /dn /n "\\server\copier"

I had all 3 of the old copiers so the script ran normally. I ran it again when I didn't have any of the old 3 and it had a stop error on each. How do I get it to continue through the error if the copier is not found and proceed to the next one?

Wait, what is the error? Its apparently expecting input from you?

edit: Just use the /q switch
 
Last edited:

plot

Morning Boehner
Oct 16, 2006
20,031
4,165
573
kansas city
Marklar
₥1,882
oops.

try
IF NOT EXISTS "\\server\copier" rundll32 printui.dll,PrintUIEntry /in /q /n "\\server\copier" ;;theoretically this checks to see if the printer is installed, if it isn't, it then installs it.
IF EXISTS "\\server\copier" rundll32 printui.dll,PrintUIEntry /dn /q /n "\\server\copier" ;;theoretically this checks to see if the printer is installed, if it is, it uninstalls it
 

Josh

Biff Clurton
Oct 9, 2006
7,751
4,053
523
East bumfuck.
Marklar
₥6,666
Back in highschool the computer class I was in, we had to write out a bat file in dos, complete with colors, menus, shadowing, and all that shit. I must have spent hours perfecting the "gui".
All it really did was run basic tasks like defrag, fdisk, format, etc. Sadly I think I forgot most of how to make colorful menus and junk. I wonder if I still have that bat file.

ansi.sys FTW