Changes made
This was added at the end of the code
Function addToDict(ByVal strPrinterPath)
If Not objDictPrnts.Exists(strPrinterPath) Then
objDictPrnts.Add strPrinterPath, strPrinterPath
End If
End Function
All printer statements were changed to the following
[Code}
If...
Well in this case it may.
This is being written for a school setting. If the teacher has requested that they have a specific printer anywhere they log in, and we want the computer to have the same printer by default (no matter who is sitting there) then we will have overlapping printers and we...
Completely new to vbs. I know in php I could add a ! to make it the opposite and eliminate the Then with nothing to do there. I don't know if that can be done in vbs.
Function addToDict(ByVal strPrinterPath)
If objDictPrnts.Exists(strPrinterPath)
Then
Else
objDictPrnts.Add...
To avoid this, I am thinking I need to write a function for adding to the array that checks to see if the key is already taken. That way we can move beyond this error and onto others :)
I shortened the code a bit here to make it fit. The omitted stuff is drive mapping
Option Explicit
On Error Resume Next
Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer
'change made to correct users losing the H drive KS 10/24/2012
Dim...
To be perfectly honest, I have no idea. Its how they had it in the FAQ I mentioned.
Do you have another way of doing that command? It should take in the already mapped printers and then go through the mapped ones and delete them if they exist in the objDictPrnts.
Hello everyone!
I found this FAQ and I am trying to implement part of it: http://www.tek-tips.com/faqs.cfm?fid=5798
---
Set WSHNetwork = CreateObject("WScript.Network")
'Install only missing printers from predefined list
'Thanks go to DM4Ever for this section
'Create a dictionary to store our...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.