WSH@Workshop 
HOME > WSHリファレンス > WshNetwork オブジェクト > AddWindowsPrinterConnection

AddWindowsPrinterConnection (WshNetwork オブジェクト)

Windows NT/2000:
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

関連項目

ComputerNameUserDomainUserNameAddPrinterConnectionEnumNetworkDrivesEnumPrinterConnectionMapNetworkDriveRemoveNetworkDrive
RemovePrinterConnectionSetDefaultPrinter



WSHリファレンス

FileSystemObject オブジェクト
Drive オブジェクト
Folder オブジェクト
File オブジェクト
Drives コレクション
Folders コレクション
Files コレクション


Copyright (C) 2006-2008 WSH@Workshop All rights reserved.