NSFW bat file help

JAXvillain

Curly_Sue
Oct 13, 2004
68,542
1,879
923
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,542
1,879
923
think that got it. thanks man! going to add old queues back and start from the top to double check
 

plot

Morning Boehner
Oct 16, 2006
20,031
4,165
323
kansas city
could also try
IF EXISTS "\\server\copier" rundll32 printui.dll,PrintUIEntry /in /n "\\server\copier"
 

fly

Osharts 11
Oct 1, 2004
72,300
23,892
1,073
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
323
kansas city
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,398
3,742
273
East bumfuck.
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