Hi Guys & Girls,
Iíve been asked to rectify a script related problem and was wondering if anyone else had experienced similar.
The usual story; the script has been running without problem for months. Some upgrade work has been done on the (school) network and now it has stopped working.
No changes have been made to the script.
All servers/paths/printers/shares referenced by the script are available.
Script now throws random errors and does not execute ie:
(same script both times)
A Sample of the script is below. In essence the first part strips out all network printers, and the second part adds network printers. This is done as a user moves from room to room and different printers become available.
Any ideas why the script does not run, syntax seems fine, but maybe itís not? - and the knowledge that is has been running (apparently) fine for months just confuses matters further!
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer Where Network = True")
For Each objPrinter in colInstalledPrinters
Dim oNetwork, sPrintPath, sShort
Set oNetwork = CreateObject("WScript.Network")
sShort = Left (oNetwork.ComputerName, 4)
Select Case sShort
sPrintPath = "\\support\LaserJet -204A-"
sPrintPath = "\\support\Laserjet -204B-"
sPrintPath = "\\support\LaserJet -204C-"
sPrintPath = "\\support\Laserjet -64A-"
There are currently 1 users browsing this thread. (0 members and 1 guests)