Code:
intHighNumber = 2
intLowNumber = 1
For i = 1 to 1
Randomize
intNumber = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber)
Next
Randomize
intNumber = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber)
Wscript.Echo intNumber
Dim objNetwork, strLocal, strUNCPrinter1, strUNCPrinter2
strLocal = "HPLaserJet2420"
strUNCPrinter1 = "\\print-server\LAB350-HP4350-2"
strUNCPrinter2 = "\\print-server\Reg-HP4250"
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
objNetwork.AddWindowsPrinterConnection strUNCPrinter2
objNetwork.SetDefaultPrinter strUNCPrinter&intNumber
WScript.Quit
This does not work. It says 2 does not exist. The only line I am having trouble with is that last line. I thought & was suppose to cat together those 2. So it would technically be strUNCPrinter2 or whatever number was in intNumber.