Bankesy Posted January 12, 2011 Posted January 12, 2011 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
rh91uk Posted January 12, 2011 Posted January 12, 2011 Try this ....... you will need to share the printer out from the original PC. Set net = WScript.CreateObject("wscript.network") net.SetDefaultPrinter "\\pc\printer"
Bankesy Posted January 13, 2011 Author Posted January 13, 2011 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
thesk8rjesus Posted January 21, 2011 Posted January 21, 2011 '=========================================== ' 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now