I want to send printer paths i.e \\servername\printername to a text file. i can do this for drive mapping i.e net use > c:\mappings.txt can I do this for printers?
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
DOS question
Collapse
X
-
-
-
-
Only if you map to an LPT port will it work. Net use will display mappings, and as most printers these days are not mapped...they are via IP / unc
PSTools might do it though: http://www.microsoft.com/technet/sys...s/PsTools.mspxComment
-
Use this script
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 to oPrinters.Count - 1 Step 2
WScript.Echo "Port " & oPrinters.Item(i) & " = " & oPrinters.Item(i+1)
Save to a text file e.g. ptrt.vbs then run
cscript prt.vbs >ptr.txtComment
-
Great thanks mate.Originally posted by xondoUse this script
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 to oPrinters.Count - 1 Step 2
WScript.Echo "Port " & oPrinters.Item(i) & " = " & oPrinters.Item(i+1)
Save to a text file e.g. ptrt.vbs then run
cscript prt.vbs >ptr.txtComment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers

Comment