Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WScript.Shell and printing

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2487
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WScript.Shell and printing
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WScript.Shell and printing - 3/27/2005 6:29:07 PM   
  pelegk2

 

Posts: 79
Score: 0
Joined: 3/27/2005
From: Israel
Status: offline
how can i use WScript.Shell to print to a network wprinter and html file
amd withoguht the box that ask's to choose a printer will appear (i will give the printer name in advance for example)
2)how by using WScript.Shell i can get the list of printer on my network?
thnaks in advance
Peleg
 
 
Post #: 1
 
 Re: WScript.Shell and printing - 3/28/2005 4:45:33 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
pelegk2, you can first try this

' Enumerate Printer Connections

' Description
' Enumerates all the printer connections on a computer.
' Requires Windows XP or Windows .NET Server.

' Script Code

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name
Wscript.Echo "Location: " & objPrinter.Location
Wscript.Echo "Default: " & objPrinter.Default
Next
' end of code

' The System Administration Scripting Guide, part of
' the Windows .NET Server Resource Kit. For more information,
' contact scripter@microsoft.com.


I don't know if the print box can be bypassed with a script.

Regards

< Message edited by didorno -- 7/20/2005 7:59:20 AM >

(in reply to pelegk2)
 
 
Post #: 2
 
 Re: WScript.Shell and printing - 3/29/2005 12:35:10 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
To print to a printer that has a associated old fashioned local LPT port, you could just probably redirect them (using the > symbol) to the desired port. I'm not sure if it will worked with UNC path name, you could give it a try and see if it works.

If you could post whatever you have coded so far, others might be able to help you more.

(in reply to pelegk2)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WScript.Shell and printing Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts