Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 29th, 2008, 02:24 PM
Newbie
 
Join Date: Aug 2008
Posts: 1
Default problems mapping network drive

Morning folks, if you all could loan me a hand it would be sweet.
New to VB script, so pardon me for the noob ways.

I am trying to useogon script that would map our HP LaserJet 4600s. all these machines have printservers built in. I use the script below but i keep getting the error that Printer Name is invalid when i test it out on my machine (vista business btw :( ) However I am able to map it manually.

any assistance would be much appreciated

Don't know if the below info would be useful

Print Server
ip address10.3.7.160
subnet: 255.255.248.0
gateway 10.3.7.1

Client Machine
10.3.1.21
255.255.248.0
10.3.0.58


Expand|Select|Wrap|Line Numbers
  1. Dim goWshNetwork
  2. Dim PrinterPath 
  3. Dim PrinterDriver 
  4.  
  5.  
  6. Set WshNetwork = CreateObject("WScript.Network")
  7. PrinterPath = "\\10.3.7.160\hp color LaserJet 4600"
  8. PrinterDriver = "HP Color LaserJet 4600 PCL5"
  9.  
  10. Set rc = WshNetwork.AddWindowsPrinterConnection(PrinterPath  , PrinterDriver)
  11.  
  12. If Not rc Then
  13.       'Error message here
  14. End If
  15.  
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles