mwilliamsess
IS-IT--Management
I have these functions already setup and working:
Function delPrint(pname)
Set objNetwork = CreateObject("WScript.Network")
confDel = msgbox ("Do you want to remove " & pname & " ?",vbYesNo)
If confDel = 6 Then
objNetwork.RemovePrinterConnection pname
msgbox (pname & " Has Been Removed.")
Else
msgbox (pname & " Will Not Be Removed.")
End If
End Function
Function addPrint(pname)
ON ERROR RESUME NEXT
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection pname
IF Err.Number <> 0 THEN
MSGBOX "Access Denied",16,"Denied"
ELSE
ON ERROR GOTO 0
mkDef = msgbox ("Do you want " & pname & " to be your default printer?", 292, "Default Printer Status")
If mkDef = 6 Then
WshNetwork.SetDefaultPrinter pname
msgbox ("Printer " & pname & " Installed As Default Successfully.")
Else
msgbox ("Printer " & pname & " Installed Successfully.")
End If
END IF
End Function
I need another function to map LPT1 to a printer.
Function delPrint(pname)
Set objNetwork = CreateObject("WScript.Network")
confDel = msgbox ("Do you want to remove " & pname & " ?",vbYesNo)
If confDel = 6 Then
objNetwork.RemovePrinterConnection pname
msgbox (pname & " Has Been Removed.")
Else
msgbox (pname & " Will Not Be Removed.")
End If
End Function
Function addPrint(pname)
ON ERROR RESUME NEXT
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection pname
IF Err.Number <> 0 THEN
MSGBOX "Access Denied",16,"Denied"
ELSE
ON ERROR GOTO 0
mkDef = msgbox ("Do you want " & pname & " to be your default printer?", 292, "Default Printer Status")
If mkDef = 6 Then
WshNetwork.SetDefaultPrinter pname
msgbox ("Printer " & pname & " Installed As Default Successfully.")
Else
msgbox ("Printer " & pname & " Installed Successfully.")
End If
END IF
End Function
I need another function to map LPT1 to a printer.