<?xml version="1.0" encoding="UTF-8" ?><oembed><version>1.0</version><provider_name>Jui-Nan Lin&#039;s Blog</provider_name><provider_url>https://jnlin.org</provider_url><author_name>jnlin</author_name><author_url>https://jnlin.org/author/jnlin/</author_url><title>設定 samba3 自動安裝 Windows 的印表機驅動程式</title><html>&lt;p&gt;如果使用 Windows 來分享印表機，使用者可以在連線到印表機的同時自動安裝好驅動程式；之前以為用 samba 不能作到，不過今天一查資料發現可以，只是會有一些地雷……XD 以下就是簡單的步驟說明：&lt;/p&gt;  &lt;p&gt;假設印表機已經以 cups 設定好了，並且採用 RAW 模式直接輸出到印表機：&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;建立 print$ 這個分享目錄。      &lt;br /&gt;在 smb.conf 中加入：       &lt;br /&gt;      &lt;blockquote&gt;&lt;font face=&quot;Courier&quot;&gt;[print$]          &lt;br /&gt;path=/home/data/samba/drivers           &lt;br /&gt;browseable=no           &lt;br /&gt;read only=yes           &lt;br /&gt;write list = root           &lt;br /&gt;case sensitive = no           &lt;br /&gt;preserve case = No&lt;/font&gt;&lt;/blockquote&gt;   &lt;/li&gt;    &lt;li&gt;先找台 Windows 機器，連接上印表機並且設定好印表機的分享。假設這台 Windows 機器名字叫做 WINPC：      &lt;blockquote&gt;&lt;font face=&quot;Courier&quot;&gt;# net rpc printer MIGRATE DRIVERS HPLaserJet -U root -S WINPC &lt;/font&gt;&lt;/blockquote&gt; 其中 HPLaserJet 是印表機分享的名字，在 Windows 與 cups 上要取一樣的名字。 &lt;/li&gt;    &lt;li&gt;如果出現 &lt;font face=&quot;Courier&quot;&gt;WERR_ACCESS_DENIED&lt;/font&gt; 的錯誤訊息，先試著增加 &lt;font face=&quot;Courier&quot;&gt;SePrintOperatorPrivilege&lt;/font&gt; 的權限給 root：       &lt;blockquote&gt;&lt;font face=&quot;Courier&quot;&gt;# net rpc rights grant root SePrintOperatorPrivilege -U root&lt;/font&gt;&lt;/blockquote&gt; 如果還是不行，檢查 smb.conf 的 [printers] 區段內有沒有 &lt;font face=&quot;Courier&quot;&gt;use client driver = yes&lt;/font&gt; 的設定，有的話請暫時將它拿掉即可。 &lt;/li&gt;    &lt;li&gt;如果要設定 Windows x64 版本的 Driver，就在 WINPC 上安裝 Windows x64 的 Driver，再重新跑一遍 net rpc printer MIGRATE DRIVERS 就可以了。 &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;參考資料：&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href=&quot;http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/NetCommand.html#id2596430&quot;&gt;Samba How-To Collection: Chapter 13. Remote and Local Management: The Net Command&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/rights.html#id2601753&quot;&gt;Samba How-To Collection: Chapter 15. User Rights and Privileges&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/classicalprinting.html#id2619652&quot;&gt;Samba How-To Collection: Chapter 21. Classical Printing Support&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://lists.samba.org/archive/samba/2004-January/078630.html&quot;&gt;Samba Maillist: [Samba] Samba PDC and Automatic Printer Install&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://csc.ocean-pioneer.com/docum/samba_print.html&quot;&gt;samba 如何設定自動安裝 windows 印表機的驅動程式&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;</html><type>rich</type></oembed>