AddWindowsPrinterConnection (WshNetwork オブジェクト)
Windows NT/2000:
object.AddWindowsPrinterConnection(path)
Windows 9x/Me:
object.AddWindowsPrinterConnection(path, drive, [port])
object.AddWindowsPrinterConnection(path)
Windows 9x/Me:
object.AddWindowsPrinterConnection(path, drive, [port])
引数
- object
- WshNetwork の名前を指定します。
- path
- プリンタ接続へのパスを指定します。
- drive
- ドライブ名を指定します。(Windows 9x/Meのみ)
- port
- プリンタ接続のプリンタ ポートを指定します。(Windows 9x/Meのみ)
解説
Windows ベースのプリンタ接続をコンピュータ システムに追加します。
使用例
'Windows NT/2000の場合
Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\Server1\Printer1"
WshNetwork.AddWindowsPrinterConnection PrinterPath
''Windows 9x/Meの場合
Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\Server1\Printer1"
PrinterDriver = "Canon Printer Driver"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
AddWindowsPrinterConnection (WshNetwork オブジェクト) に関連する項目
| ComputerName | コンピュータ名を返します。 |
| UserDomain | ユーザー ドメイン名を返します。 |
| UserName | ユーザー名を返します。 |
| AddPrinterConnection | リモートの MS-DOS ベースのプリンタ接続をコンピュータ システムに追加します。 |
| EnumNetworkDrives | ネットワーク ドライブの現在の割り当てを返します。 |
| EnumPrinterConnection | ネットワーク プリンタの現在の割り当てを返します。 |
| MapNetworkDrive | 共有ネットワーク ドライブをコンピュータ システムに追加します。 |
| RemoveNetworkDrive | コンピュータ システムの共有ネットワーク ドライブ接続を解除します。 |
| RemovePrinterConnection | コンピュータ システムの共有ネットワーク プリンタ接続を解除します。 |
| SetDefaultPrinter | 指定されたリモート プリンタを既定のプリンタとして設定します。 |
WSH講座
WSH とは
Windows Script Host (WSH) は、Windows 管理ツール用のスクリプト言語です。
WSH に必要な環境
WSHは、Windows98以降に標準で搭載され、イ... |
WSH の書き方
WSHは VBScript または Javascript で記述します。
VBScript は「.vbs」、Javascript は「.js」という拡張子を付けてファイルを作成します。
... |
WscriptとCscriptの違い
WSHはWscriptまたはCscriptで起動できます。
WScriptとCScriptはほぼ同様の機能を持ちますが、WScriptは対話向け、CScriptは
コン... |
WMI とは
Windows Management Instrumentation (WMI) は、Windowsシステムを管理するため
のインターフェースです。
Windows 2000以降のWindows OSには... |
