progtips

プリンターの一覧を得る

最終更新:

progtips

- view
メンバー限定 登録/ログイン

ソース

Set wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2")

s = ""
For Each prn In wmi.ExecQuery("Select * from Win32_Printer")
	s = s & prn.Name & ":" & prn.PortName & vbCrLf
Next

WScript.Echo s

解説

普通にWMIを使う。

ポートの変更とかはよくわからないや。
記事メニュー
ウィキ募集バナー