All pastes #793099 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-21 23:06 UTC
rendered paste body
'---------------------------------------------------------------------
'setup the printshares
'---------------------------------------------------------------------
On Error Resume Next
'title for all dialog boxes
title = "STS Drive/print map script "
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server\KONICA-C450PCL"
WshNetwork.AddWindowsPrinterConnection "\\server\HPLaserJ"
WshNetwork.AddWindowsPrinterConnection "\\server\HPOffice"
Err.Clear
'confirmed with Sheryl that all systems should default to LASER4 Printer. 20070703
WshNetwork.SetDefaultPrinter "\\server\HPLaserJ"
WshNetwork.AddWindowsPrinterConnection "\\server\HPOffice"
If Err <> 0 Then 
	MsgBox "Problem setting HP LaserJet as default printer:" + vbCR + vbCR + Err.Description,,title
end If
Err.Clear

'---------------------------------------------------------------------
'setup the s-drive share
'---------------------------------------------------------------------

'remove any existing mapping
WshNetwork.RemoveNetworkDrive "S:"
'ignore any errors on de-mapping the S: drive
Err.Clear 
WshNetwork.MapNetworkDrive "s:", "\\server\s-drive"
If Err <> 0 Then 
	MsgBox "There was a problem mapping the S-drive: " + vbCR + vbCR + Err.Description,,title
end If
Err.Clear