{"id":749,"date":"2005-09-08T22:39:40","date_gmt":"2005-09-09T03:39:40","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/?p=3"},"modified":"2005-09-08T22:39:40","modified_gmt":"2005-09-09T03:39:40","slug":"default-printer","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2005\/09\/08\/default-printer\/","title":{"rendered":"Default Printer"},"content":{"rendered":"<p>This piece of code, simple as it is, took me a long while to develop.  I am not well versed in Visual Basic and yet needed to find the default printer.  I searched in a 1000+ page book, all over the internet, and after a lot of trial and error got it working.  This Visual Basic script code block returns the default printer:<\/p>\n<pre>\n' Returns the default printer\nFunction GetDefaultPrinter()\n   Set WshShell = WSCript.CreateObject(&quot;WScript.Shell&quot;)\n   sRegVal = &quot;HKCU\\Software\\Microsoft\\Windows &quot;\n   sRegVal = sRegVal & &quot;NT\\CurrentVersion\\Windows\\Device&quot;\n   sDefault = &quot;&quot;\n\n   sDefault = WshShell.RegRead(sRegVal)\n   sDefault = Left(sDefault, InStr(sDefault, &quot;,&quot;) - 1)\n\n   GetDefaultPrinter = sDefault\nEnd Function\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This pieced of code, simple as it is, took me a long while to develop.  I am not well versed in &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[3,5],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-c5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/749"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=749"}],"version-history":[{"count":0,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}