[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-logonpy/etc/se3/python/ -> logonPrinters.vbs (source)

   1  On Error Resume Next
   2  Const HKEY_CURRENT_USER = &H80000001
   3  strComputer = "."
   4  
   5  Set objNetwork = CreateObject("WScript.Network")
   6  
   7  Set objRegistry = GetObject("winmgmts:\\" & _
   8      strComputer & "\root\default:StdRegProv") 
   9  
  10  Sub DeleteUserSubkeys(strKeyPath) 
  11      objRegistry.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubkeys 
  12  
  13      If IsArray(arrSubkeys) Then 
  14          For Each strSubkey In arrSubkeys 
  15              DeleteUserSubkeys strKeyPath & "\" & strSubkey 
  16          Next 
  17      End If 
  18  
  19      objRegistry.DeleteKey HKEY_CURRENT_USER, strKeyPath 
  20  End Sub
  21  
  22  Sub DeleteUserPrintersDevice(server)
  23      Set objPrinter = objNetwork.EnumPrinterConnections
  24      For intDrive = 0 To (objPrinter.Count -1) Step 2
  25          intNetLetter = IntNetLetter +1
  26          If (InStr(objPrinter.Item(intDrive+1), server)> 0) Then
  27              objNetwork.RemovePrinterConnection objPrinter.Item(intDrive+1)
  28          End If
  29      Next
  30      DeleteUserSubkeys "Printers\Connections"
  31  End Sub
  32  
  33  Sub AddUserPrinterDevice(server, printer)
  34      objNetwork.AddWindowsPrinterConnection "\\" & server & "\" & printer
  35  End Sub
  36  
  37  Sub SetUserDefaultPrinterDevice (server, printer)
  38      objNetwork.SetDefaultPrinter "\\" & server & "\" & printer
  39  End Sub


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1