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

RemovePrinterConnection (WshNetwork オブジェクト)

object.RemovePrinterConnection(name, [force], [profile])

引数

object
WshNetwork の名前を指定します。
name
接続を解除するプリンタ識別名を指定します。
UNC 名 (\\xxx\yyy の形式) またはローカル名 (LPT1など) を指定できます。
force
プリンタが使用されているかどうかに関係なく接続を解除する場合は、Trueを指定します。(省略可能)
profile
ユーザー プロファイルから割り当てを削除する場合は、Trueを指定します。(省略可能)

解説

コンピュータ システムの共有ネットワーク プリンタ接続を解除します。

使用例

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\Server1\Printer1"
WshNetwork.RemovePrinterConnection PrinterPath, true, true


関連項目

ComputerNameUserDomainUserNameAddWindowsPrinterConnectionAddPrinterConnectionEnumNetworkDrivesEnumPrinterConnectionMapNetworkDrive
RemoveNetworkDriveSetDefaultPrinter



WSHリファレンス

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


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