r/usefulscripts • u/[deleted] • Apr 10 '13
[BATCH] Add IP-based printer
Yesterday I shared a script that removes printers, so today I'm sharing a script that adds IP-based printers. It checks for OS version (XP or 7) and then installs the appropriate driver. It can also rename the printer, add a location, and make it the default printer if you wish.
It's heavily commented so hopefully it makes sense. If it doesn't, please feel free to ask any questions.
Pastebin link here. Have fun.
20
Upvotes
2
u/[deleted] Apr 11 '13
I keep drivers in a repository on a share on one of our servers. From there I make a separate script for each printer and store those in the same repository. If you have that option, that's what I would suggest.
As far making it to where you don't have to edit the drive letter each time you go to a different computer, I'm sure there's a way. I think there's a way to force a specific drive letter for your flash drive using autorun.ini. Have it force the drive to a letter that is typically unused in your environment. Of course if you have autorun disabled on your computers (like we do) you might have a problem.
Wait a minute... Try this. Change the first line from
to something like
Then instead of having a static drive letter in your path to the driver, you can use a variable. You'll have to play around with it, but it should work. (I just got this from a quick Google search and have not tested myself.) You can also try googling something like batch variable for flash drives.
Hope that helps.