NSFW bat file help

shamwow

Curly_Sue
Oct 13, 2004
66,888
709
41
Marklar
₥0.40
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?
 

fly

Osharts 11
Oct 1, 2004
67,549
19,832
1,073
Marklar
₥46,624.23
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,015
4,145
323
kansas city
Marklar
₥1,877.10
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
6,537
2,566
273
37
Marklar
₥6,122.72
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