Jump to content

Recommended Posts

Posted

Hello

 

I was hoping somebody might have a good script I could use for print sharing.

 

The printer is attached to a machine running Windows Vista and needs to be accessed from another machine running Vista as well as 2 machines running XP.

 

My plan is to put the script in the start up folder for all users so anybody who logs on can see the printer.

 

Thankyou

Posted

Try this ....... you will need to share the printer out from the original PC.

 

Set net = WScript.CreateObject("wscript.network")

 

net.SetDefaultPrinter "\\pc\printer"

Posted

Hello

 

Can anybody suggest why the following print sharing script appears to not work with Vista but does work with XP and 7?

 

@ECHO OFF

ECHO Installing ...

%logonserver%\netlogon\adprintx /cd "\\\"

ECHO Finished...

EXIT

 

Thankyou

  • 2 weeks later...
Posted

'===========================================

' Creating Variables

'===========================================

ON ERROR RESUME NEXT

Dim objNetwork, objPrinter

Set objNetwork = CreateObject("WScript.Network")

Set objPrinter = objNetwork.EnumPrinterConnections

 

'===========================================

' Deleting All Network Printers

'===========================================

objNetwork.RemovePrinterConnection "\\%MachineName%\%PrinterShareName%", True, True

 

'===========================================

' Adding New Printers

'===========================================

objNetwork.AddWindowsPrinterConnection "\\%MachineName%\%PrinterShareName%"

 

'===========================================

' Setting Default Printer

'===========================================

objNetwork.SetDefaultPrinter "\\%MachineName%\%PrinterShareName%"

 

 

'===========================================

' Clearing Memmory

'===========================================

Set objNetwork = Nothing

Set objPrinter = Nothing

 

 

Save this as a .vbs script this is what we use at our school this will work with all versions of windows, and does funny things on mac

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...