Loading |
VBScript |
JavaScript |
Powershell |
Search Options: List the Network Printers For the Logged-On UserContent of List the Network Printers For the Logged-On User.vbsMD5 Hash: 9E3674CBF055419053930C0480CCF7B3 |
||
Const ForWriting = 2
Set objNetwork = CreateObject("Wscript.Network") strName = objNetwork.UserName strDomain = objNetwork.UserDomain strUser = strDomain & "\" & strName strText = strUser & vbCrLf strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colPrinters = objWMIService.ExecQuery _ ("Select * From Win32_Printer Where Local = FALSE") For Each objPrinter in colPrinters strText = strText & objPrinter.Name & vbCrLf Next Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile _ ("C:\Scripts\Printers.txt", ForWriting, True) objFile.Write strText objFile.Close | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |