Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Trouble with running a VBS within a VBS for Printer setups

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Trouble with running a VBS within a VBS for Printer setups
  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 >>
 Trouble with running a VBS within a VBS for Printer setups - 1/25/2008 10:27:41 AM   
  yo_bee

 

Posts: 2
Score: 0
Joined: 1/24/2008
Status: offline
I am new to this forum.  So I want to just introduce myself.
 
I am very new to scripting.  I always depended on the GUI.  Then I started to play around with scripts to help myself administer my network.
 
So here is my code I am having troube with it.  Its using the prnport.vbs, prndrvr.vbs and prnmngr.vbs that is included with XP
 
I was able to get the prnport.vbs and I think I got the prndrvr.vbs to work, but the prnmngr.vbs is giving an error at the first char line 59
 
 

      

 
Can someone please tell me what I am missing here
 
 
 
If I run cscript prndrvr.vbs -a   .......... in a bat file it works, but I can not get the vbs with the parameters to run properly
 
 
 
Post #: 1
 
 RE: Trouble with running a VBS within a VBS for Printer... - 1/25/2008 4:32:14 PM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
I'm guessing you haven't seen the frequently asked stuff post....

strmngr1 = "cscript c:\windows\system32\prnmngr.vbs -a -p Printer3 -m " & Chr(34) & "HP LaserJet 4350 PS" & Chr(34) & " -r Printer3"


Whenever using .Run you need to account for the extra " where needed....you can do it like it is shown above or

strmngr1 = "cscript c:\windows\system32\prnmngr.vbs -a -p Printer3 -m " & """HP LaserJet 4350 PS""" & " -r Printer3"

or

insert a function like this somewhere in your script

Function AddQuotes(strText)
   AddQuotes = Chr(34) & strText & Chr(34)
End Function

and then use this:   strmngr1 = "cscript c:\windows\system32\prnmngr.vbs -a -p Printer3 -m " & AddQuotes("HP LaserJet 4350 PS") & " -r Printer3"

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to yo_bee)
 
 
Post #: 2
 
 RE: Trouble with running a VBS within a VBS for Printer... - 1/26/2008 12:31:05 AM   
  yo_bee

 

Posts: 2
Score: 0
Joined: 1/24/2008
Status: offline
Thank you for your help. 

I will try this Monday. 

And yes I did not read the FAQ section. 


(in reply to yo_bee)
 
 
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 >> Trouble with running a VBS within a VBS for Printer setups 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