'------------------------------------------------------------------------- 'Logon script for all users. Maps drives and Printers. Also updates the ' virus definitions for Symantec Antivirus ' '5/12/2004 Todd Woolums (twoolums@toddwoolums.com) 'Version 1.0 '------------------------------------------------------------------------- Dim driveletter, drivepath, printerpath Set FSO = WScript.CreateObject("Scripting.FileSystemObject") Set WshNetwork = WScript.CreateObject("WScript.Network") Set objShell = CreateObject("WScript.Shell") sDomain = WshNetwork.UserDomain strUser = UCase(WshNetwork.UserName) strComputer = "." CAll MAPDRIVE("M:","\\server\share") CALL MAPPRINTER("\\server\printer Call VIRUSUPDATE Sub MAPDRIVE(driveletter, drivepath) On Error Resume Next If FSO.DriveExists(driveletter) Then WshNetwork.RemoveNetworkDrive driveletter End If WshNetwork.MapNetworkDrive driveletter, drivepath End sub Sub MAPPRINTER(printerpath) On Error Resume Next WshNetwork.addwindowsprinterconnection printerpath End sub Sub VIRUSUPDATE Set objExplorer = WScript.CreateObject("InternetExplorer.Application") objExplorer.Navigate "about:blank" objExplorer.ToolBar = 0 objExplorer.StatusBar = 0 objExplorer.Width=400 objExplorer.Height = 200 objExplorer.Left = 0 objExplorer.Top = 0 Do While (objExplorer.Busy) Wscript.Sleep 200 Loop objExplorer.Visible = 1 objExplorer.Document.Body.InnerHTML = "Retrieving Virus Definitions. " & "This might take several minutes to complete." Set objShell = CreateObject("Wscript.shell") Set objScriptExec = objShell.Exec("c:\progra~1\symantec\liveupdate\luall.exe -s") Wscript.Sleep 3000 objExplorer.Quit End sub