{"id":103,"date":"2008-11-03T08:00:00","date_gmt":"2008-11-03T07:00:00","guid":{"rendered":"http:\/\/www.razumny.no\/blog\/?p=103"},"modified":"2009-10-30T14:10:04","modified_gmt":"2009-10-30T13:10:04","slug":"installing-printers-using-a-batch-script","status":"publish","type":"post","link":"https:\/\/www.razumny.no\/?p=103","title":{"rendered":"Installing printers using a batch script"},"content":{"rendered":"<p>Part of my job is installing printers for users. Now, I could just go on mapping the printserver and finding the printer from there, but that takes a lot of time, as we have some 100 plus printers per printserver. Instead, I spent an hour creating batch scripts, and have since used them to install printers.<br \/>\n&nbsp;<br \/>\nThe command we need is an extension of the <code>rundll32<\/code> command. The basic command is this: <code>rundll32 printui.dll,PrintUIEntry<\/code>. Now, just this will not really help you. You need to define some switches and operators. First off, you might want to know what switches and operators are available to you. To find them, simply open the &#8220;run&#8221; dialog box, and enter the command <code>rundll32 printui.dll,PrintUIEntry \/?<\/code>. This will yield an information box looking something like this:<br \/>\n&nbsp;<br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" title=\"Information box containing shitloads of information\" src=\"https:\/\/i0.wp.com\/www.razumny.no\/images\/blog\/UIInfo.jpg\" alt=\"Information box containing shitloads of information\" \/><br \/>\n&nbsp;<br \/>\nThe command I usually use looks something like this:<br \/>\n&nbsp;<br \/>\n<code>rundll32 printui.dll,PrintUIEntry \/in \/q \/n  \"\\\\PRINTSERVER\\PRINTER\"<\/code><br \/>\n&nbsp;<br \/>\nThe switches I use are:<br \/>\n<code>\/in<\/code> &#8211; Adds a network printer connection<br \/>\n<code>\/q<\/code> &#8211; Runs in quiet mode<br \/>\n<code>\/n<\/code> &#8211; Defines what printer to add<br \/>\n&nbsp;<br \/>\nThere are many possibilities with this script, and I have never seen it fail.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part of my job is installing printers for users. Now, I could just go on mapping the printserver and finding the printer from there, but that takes a lot of time, as we have some 100 plus printers per printserver. Instead, I spent an hour creating batch scripts, and have since used them to install [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[507],"tags":[506,505,508,509,504,954],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-script","tag-batch-script","tag-install","tag-printer","tag-printer-install","tag-printers","tag-script"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p2ukSU-1F","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":46,"url":"https:\/\/www.razumny.no\/?p=46","url_meta":{"origin":103,"position":0},"title":"Creating a shortcut and hotkey to Windows&#8217; &quot;Safely Remove Hardware&quot; dialog","author":"Aleksander Nordgarden-R\u00f8dner","date":"13\/06\/2008","format":false,"excerpt":"In a previous post I talked about using Windows' \"Safely Remove Hardware\" dialog to avoid losing data from USB drives. Having done some more research, I've found a way to create a shortcut to this dialog. The shortcut is simple to create, and uses a RunDll32.exe command that looks like\u2026","rel":"","context":"In &quot;Hack&quot;","block_context":{"text":"Hack","link":"https:\/\/www.razumny.no\/?cat=21"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":96,"url":"https:\/\/www.razumny.no\/?p=96","url_meta":{"origin":103,"position":1},"title":"Finding the name of a service","author":"Aleksander Nordgarden-R\u00f8dner","date":"20\/10\/2008","format":false,"excerpt":"In my last post, I showed you how to use a batch script to start a service from a desktop shortcut. The command we used was the net start command. In order to use it, you need to find the name of the service you want to start. Here's how:\u2026","rel":"","context":"In &quot;Microsoft Windows&quot;","block_context":{"text":"Microsoft Windows","link":"https:\/\/www.razumny.no\/?cat=360"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2532,"url":"https:\/\/www.razumny.no\/?p=2532","url_meta":{"origin":103,"position":2},"title":"Run Control Panel applets with elevated permissions","author":"Aleksander Nordgarden-R\u00f8dner","date":"11\/08\/2014","format":false,"excerpt":"Sometimes, you want to launch a Control Panel applet with elevated permissions. Normally, you would right-click the program you want, and select to run as an administrator. However, the control panel applets don't\u00a0give you that option, and so we need to go deeper. As it turns out, the Control Panel\u2026","rel":"","context":"In &quot;How To&quot;","block_context":{"text":"How To","link":"https:\/\/www.razumny.no\/?cat=615"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3172,"url":"https:\/\/www.razumny.no\/?p=3172","url_meta":{"origin":103,"position":3},"title":"TBT: Finding the name of a service","author":"Aleksander Nordgarden-R\u00f8dner","date":"16\/07\/2015","format":false,"excerpt":"This post originally ran in October 2008. I am reposting it now, as part of my throwback thursday project, to\u00a0give some of my older quality posts some love. Though the post references Windows XP; the method outlined below\u00a0works in later versions, too. In my last post, I showed you how\u2026","rel":"","context":"In &quot;TBT&quot;","block_context":{"text":"TBT","link":"https:\/\/www.razumny.no\/?cat=894"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":39,"url":"https:\/\/www.razumny.no\/?p=39","url_meta":{"origin":103,"position":4},"title":"Apt-get FTW or: How I learned to stop worrying and learned to love Ubuntu","author":"Aleksander Nordgarden-R\u00f8dner","date":"28\/05\/2008","format":false,"excerpt":"I love technology and fiddling with computers and gadgets dearly, and so, one of my long-term goals have been to has an operational computer running Linux, with which I can do most, if not all, of what I am able to do with my Windows computers.\u00a0Like most IT-professionals who has\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.razumny.no\/?cat=108"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76,"url":"https:\/\/www.razumny.no\/?p=76","url_meta":{"origin":103,"position":5},"title":"Installing Uplink on Ubuntu Linux","author":"Aleksander Nordgarden-R\u00f8dner","date":"29\/08\/2008","format":false,"excerpt":"Uplink is a really fun game that I've played on and off over the years. Having gotten my Ubuntu-computer up and running, I felt it would only be natural to pick it back up. Installing it isn't as straightforward as in Windows though, as I quickly realized. This is how\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.razumny.no\/?cat=108"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":4,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":652,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/652"}],"wp:attachment":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}