Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Batch file to add a network printer

 
   Windows (Home) -> Customize RSS
Next:  Explorer  
Author Message
Lee

External


Since: Apr 20, 2004
Posts: 3



(Msg. 1) Posted: Tue Apr 20, 2004 1:01 am
Post subject: Batch file to add a network printer
Archived from groups: microsoft>public>windowsxp>customize (more info?)

Hi,
I want to create a batch file that, when it is run from a workstation, automatically connects to a network printer. If someone could let me know what the syntax for this would be I would really appreciate it. Thankyou.

Regards,
Lee
Back to top
Login to vote
Carrie Garth

External


Since: Aug 13, 2004
Posts: 10



(Msg. 2) Posted: Tue Apr 20, 2004 5:06 am
Post subject: Re: Batch file to add a network printer [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> "Lee" <anonymous.DeleteThis@discussions.microsoft.com>
> wrote in message news:A3918E70-C3C0-4931-96E0-B318605A0FD3@microsoft.com...
> I want to create a batch file that, when it is run from a workstation,
> automatically connects to a network printer. If someone could let me know what the
> syntax for this would be I would really appreciate it. Thankyou.

You might be able to find a suitable script from the samples at the following site:

Microsoft TechNet Script Center - Printing
http://www.microsoft.com/technet/community/scriptcenter/printing/default.mspx

And if you do not, or need any help with batch files, you may want to try posting
in the following Microsoft Newsgroup:

microsoft.public.win2000.cmdprompt.admin

Your newsgroup message header seems to indicate that you are posting to the Microsoft
Public Newsgroups using the Microsoft Communities Web Page. If I am correct, if you
click the first link below it will open your browser to:

Microsoft Communities Newsgroups Web Interface:
microsoft.public.win2000.cmdprompt.admin
http://communities2.microsoft.com/communities/newsgroups/en-us/default...px?dg=m

If you read newsgroups using a NNTP newsreader, such as Outlook Express, and
use the msnews.microsoft.com news server, here is a link:
news://msnews.microsoft.com/microsoft.public.win2000.cmdprompt.admin
Back to top
Login to vote
David Candy

External


Since: Oct 05, 2004
Posts: 115



(Msg. 3) Posted: Wed Apr 21, 2004 7:55 am
Post subject: Re: Batch file to add a network printer [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Error Resume Next
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("WScript.Shell")
strDriveHarasty = "Z:"
strDriveMorestaff = "Y:"

WshNetwork.MapNetworkDrive strDriveHarasty, "\\Server5\Share"
ReportErrors "Mapping Drive."
WshNetwork.MapNetworkDrive strDriveMorestaff, "\\Server5\Share"
ReportErrors "Mapping Drive."

WshNetwork.AddWindowsPrinterConnection "\\davidcan\HP Laser Jet 6L"
ReportErrors "Adding Printer."
WshNetwork.SetDefaultPrinter "\\h8\HP Laser Jet 6L"
ReportErrors "Setting Default Printer."
Sub ReportErrors(ErrText)
If err.number <> 0 then
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.LogEvent 1, ErrText & " Error code " & err.number & " (" & err.description & ")"
Err.clear
End If
End Sub



--
----------------------------------------------------------
http://www.g2mil.com/Dec2003.htm
"Lee" <anonymous.DeleteThis@discussions.microsoft.com> wrote in message news:A3918E70-C3C0-4931-96E0-B318605A0FD3@microsoft.com...
> Hi,
> I want to create a batch file that, when it is run from a workstation, automatically connects to a network printer. If someone could let me know what the syntax for this would be I would really appreciate it. Thankyou.
>
> Regards,
> Lee
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Batch file not running to completion - I'm trying to set up a batch file (text below) that starts a bunch of my "usual suspect" apps. Excel (and Mozilla for that matter) doesn't appear to return control to the command processor, so the batch file stops running (e.g. if I close E...

Browsing Computers problem in My Network Places - Hi all, When I browse the Entire Network in the "My Network Places" of Windows XP, I see the list of Computers in my network as usual and as expected. But the problem I have with WindowsXP is that when you browse all computers it shows you the ...

Blue file names. - I have a computer with XP PRO with all critical updates applied. The issue is in certain folders some, not all, the file names are in blue text. This IS NOT the Windows install folder showing the applied updates folders. Any help is greatly..

automatic file compression - Hi, When windows xp is low on disk space it starts auto compressing files. It was stupid enough to compress system32 and dllcache. I found out dllcache is stupid in itself. I guess windows xp is constantly decompressing dllcache to see if a dll has..

Change default file view - How do I change the default file view to show details in Windows Explorer. Can I also change this in Excel XP when I open a file? The current view shows icons and this is driving me nuts!
       Windows (Home) -> Customize All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
  Windows Forums
 Game Forums
 Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact