I am running Windows XP SP2 systems at multiple locations that log into a
Active Directory domain and have logon scripts launched via GP. I have VBS
scripts, that run with the logon scripts, that add/remove connections to
network printers. These scripts have been running fine up until about a
month ago when I started getting reports of an error message that comes up
after the script has finished running. WScript.exe - Application Error. The
instruction at "0x7c91103c" referenced memory at "<address>". The memory
could not be "written". The "0x7c9110c" seems to remain constant whereas the
second <address> changes.
The following is an example of a script that is receiving this error:
On Error Resume Next
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.RemovePrinterConnection "\\BLV501\ANNEX_BLACK"
WshNetwork.RemovePrinterConnection "\\BLV501\ANNEX_COLOR"
WshNetwork.RemovePrinterConnection "\\BLV501\CENTRAL_BLACK"
WshNetwork.RemovePrinterConnection "\\BLV501\CENTRAL_COLOR"
WshNetwork.RemovePrinterConnection "\\BLV501\FRONT_DESK_FAX"
WshNetwork.RemovePrinterConnection "\\BLV501\NORTH_BLACK"
WshNetwork.RemovePrinterConnection "\\BLV501\NORTH_COLOR"
WshNetwork.RemovePrinterConnection "\\BLV501\SOUTH_COLOR"
WshNetwork.RemovePrinterConnection "\\BLV501\SOUTH_BLACK"
WshNetwork.RemovePrinterConnection "\\BLV501\STAFF_BLACK"
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\BLV501\ANNEX_BLACK"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\ANNEX_COLOR"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\CENTRAL_BLACK"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\CENTRAL_COLOR"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\FRONT_DESK_FAX"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\NORTH_BLACK"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\NORTH_COLOR"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\SOUTH_COLOR"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\SOUTH_BLACK"
WshNetwork.AddWindowsPrinterConnection "\\BLV501\STAFF_BLACK"
I have seemed to narrow the problem down to the "On Error Resume Next"
command. If I remove this from the script it will run without the error at
the end, however if the script tries to delete a printer that is not
installed on the local computer or add a printer that the user does not have
permissions for it throws an error and does not complete.
I am relatively new to scripting and most of my experience has been editing
existing scripts. Any help would be appreciated.
Thanks in advance for all your help
David