Jump to content

Recommended Posts

Posted

We have been having a few printer issues of late so I decided to make my first venture forth into vbs. Found the printers . vbs file. Made a copy of it and edited for one XP Pro room, Ran the vbs file locally and it did almost all I wanted logged on with admin rights - the exception being it failed to change the default printer.

 

Then copy and pasted my edited room into the Netlogon Scripts printers . vbs file.

 

Logging on as a student a couple of hours after this though it failed to apply at setting just one domain printer and leaving MS XPS Document Writer as the default.

 

Why would this be happening?

Posted

Thanks Steve,

 

As the vbs sits in the scripts file in the Netlogon folder I was assuming that they must have. Perhaps not - how would I check they are enabled to run it on logon?

 

Do the student accounts have access to run it? Bearing in mind login scripts run as user context.

 

Steve

Posted

Add

Wscript.echo "printer script run"

 

To your script then you can get a pop up message if it has run.

If it is running and the printer is still not working does the workstation have the driver for that printer installed?

  • Thanks 1
Posted
Thanks Steve,

 

As the vbs sits in the scripts file in the Netlogon folder I was assuming that they must have. Perhaps not - how would I check they are enabled to run it on logon?

 

As mentioned above, an echo will show if script runs. Also depends how you are setting default, if by exe is it blocked? If by regkey can users edit that part? Etc etc

 

Might be worth sticking script up to take a look at,

 

 

Steve

  • Thanks 1
Posted

Ok folks. I'm not going great guns with this vbs thing so thought I'd post up the content of our current printer script.

 

the big thing that makes me head scratch is the fact there have been a lot of clients added since the script was last altered yet they seem to be picking up the default printer correctly from somewhere. Tomorrow that beastie gets put into retirement and a new machine takes it's place - gulp!

 

Set WshNetwork = CreateObject("WScript.Network")

Dim CN

CN = WSHNetwork.ComputerName

if CN = "HIPHOP3" or _

CN = "HIPHOP4" or _

CN = "HIPHOP6" or _

CN = "STAFFROOM2" or _

CN = "STAFFROOM3" or _

CN = "STAFFROOM5" or _

CN = "YOUR-E641889C92" or _

CN = "MSILAPTOP-KP" then

WshNetwork.AddwindowsPrinterConnection "\\LBROOM1\HPROOM5"

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\AP3800C-PCL5c"

WshNetwork.SetDefaultPrinter "\\LBROOM1\HPROOM5"

end if

if CN = "FJSULNO1" or _

CD = "M2No4" or _

CD = "New55" or _

CD = "MATHS72" or _

CD = "M2No2" or _

CD = "M2No1" or _

CD = "New61" or _

CD = "DUPLONE" then

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\AP3800C-PCL5c"

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\Ricoh Aficio 2060 PCL6"

WshNetwork.SetDefaultPrinter "\\************-DC1\Ricoh Aficio 2060 PCL6"

end if

if CN = "LBROOM1" then

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\AP3800C-PCL5c"

WshNetwork.SetDefaultPrinter "hp psc 700 series"

end if

if CN = "DOWNLOAD-CIZD2K" or _

CD = "MATHS2" or _

CD = "MATHS4" or _

CD = "MATHS5" or _

CD = "MATHS6" or _

CD = "MATHS7" or _

CD = "MATHS8" then

WshNetwork.AddwindowsPrinterConnection "\\MATHS1\HPPSC700"

WshNetwork.SetDefaultPrinter "\\MATHS1\HPPSC700"

end if

if CN = "TD7" or _

CD = "td1" or _

CD = "td2" or _

CD = "kh12" or _

CD = "td4" or _

CD = "td8" or _

CD = "td10" or _

CD = "technology1" or _

CD = "ict-room" then

WshNetwork.AddwindowsPrinterConnection "\\TD7\JBN"

WshNetwork.AddwindowsPrinterConnection "\\ict-room\RolandMO"

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\AP3800C-PCL5c"

WshNetwork.AddwindowsPrinterConnection "\\************-DC1\Ricoh Aficio 2060 PCL6"

WshNetwork.SetDefaultPrinter "\\************-DC1\AP3800C-PCL5c"

end if

if CN = "CYBERXP1" or _

CD = "CYBERXP2" or _

CD = "NEC100" then

WshNetwork.AddwindowsPrinterConnection "\\XPSTATION1\BROTHERH"

WshNetwork.AddwindowsPrinterConnection "\\XPSTATION1\HPPSC750"

WshNetwork.SetDefaultPrinter "\\XPSTATION1\BROTHERH"

end if

if CN = "ITHS02" or _

CD = "ITHS03" or _

CD = "ITHS04" or _

CD = "ITHS05" or _

CD = "ITHS06" or _

CD = "ITHS07" or _

CD = "ITHS08" then

WshNetwork.AddwindowsPrinterConnection "\\ITHS01\hppsc750"

WshNetwork.AddwindowsPrinterConnection "\\ITHS01\RolandGX24"

WshNetwork.SetDefaultPrinter "\\ITHS01\hppsc750"

end if

Posted
the big thing that makes me head scratch is the fact there have been a lot of clients added since the script was last altered yet they seem to be picking up the default printer correctly from somewhere.

 

Where's your "CD" declared? Is it just mass typo of CN?

 

Steve

  • Thanks 1
Posted
Thanks Steve,

 

Newbie I am for sure to VBS

 

Can you explain what I'm missing in greater detail please.

 

What I mean is like, from your original description are you saying some of the computers you've listed above "aren't" getting the right printer?

 

If so it's because of your "CD" part, but just want to check before changing anything :)

 

Steve

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...