Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim objLogFile, objNetwork, objShell, strText, intAns
Dim intConstants, intTimeout, strTitle, intCount, blnLog
Dim strUserName, strComputerName, strIP, strShare, strLogFile
strShare = "\\server\share"
strLogFile = "McAfee.log"
intTimeout = 20
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = CreateObject("Wscript.Shell")
strUserName = objNetwork.UserName
strComputerName = objNetwork.ComputerName
'Run this script once to record all computers
Dim varToday, Verify, LastRun
Set WshShell = CreateObject("Wscript.Shell")
varToday = "McAfee Unistalled"
Verify = "HKLM\SOFTWARE\MyInstallsAndFixes\"
'Check if scan has run today and if so exit
On Error Resume Next
LastRun = WshShell.RegRead(Verify & "McAfee Unistalled")
If Err.Number = 0 Then
WScript.Quit
Else
WshShell.RegWrite Verify & "McAfee Unistalled", 0,"REG_DWORD"
End If
On Error GoTo 0 'This turns on error handling
'******************************************************************************
WshShell.Run "msiexec /x {5DF3D1BB-894E-4DCD-8275-159AC9829B43} REMOVE=ALL REBOOT=R /q", 0, True
' Log date/time, user name, computer name, and IP address.
If objFSO.FolderExists(strShare) Then
On Error Resume Next
Set objLogFile = objFSO.OpenTextFile(strShare & "\" & strLogFile, 8, True, 0)
If Err.Number = 0 Then
' Make three attempts to write to log file.
intCount = 1
blnLog = False
Do Until intCount = 3
objLogFile.WriteLine "McAfee Unistalled ; " & Now & " ; " & strComputerName & " ; " & strUserName & " ; "
If Err.Number = 0 Then
intCount = 3
blnLog = True
Else
Err.Clear
intCount = intCount + 1
If Wscript.Version > 5 Then
Wscript.Sleep 200
End If
End If
Loop
On Error GoTo 0
If blnLog = False Then
strText = "Log cannot be written."
strText = strText & vbCrlf & "Another process may have the file open."
intConstants = vbOKOnly + vbExclamation
intAns = objShell.Popup(strText, intTimeout, strTitle, intConstants)
End If
objLogFile.Close
Else
On Error GoTo 0
strText = "Log cannot be written."
strText = strText & vbCrLf & "User may not have permissions,"
strText = strText & vbCrLf & "or log folder may not be shared."
intConstants = vbOKOnly + vbExclamation
intAns = objShell.Popup(strText, intTimeout, strTitle, intConstants)
End If
Set objLogFile = Nothing
End If
[\code]
Dim objLogFile, objNetwork, objShell, strText, intAns
Dim intConstants, intTimeout, strTitle, intCount, blnLog
Dim strUserName, strComputerName, strIP, strShare, strLogFile
strShare = "\\server\share"
strLogFile = "McAfee.log"
intTimeout = 20
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = CreateObject("Wscript.Shell")
strUserName = objNetwork.UserName
strComputerName = objNetwork.ComputerName
'Run this script once to record all computers
Dim varToday, Verify, LastRun
Set WshShell = CreateObject("Wscript.Shell")
varToday = "McAfee Unistalled"
Verify = "HKLM\SOFTWARE\MyInstallsAndFixes\"
'Check if scan has run today and if so exit
On Error Resume Next
LastRun = WshShell.RegRead(Verify & "McAfee Unistalled")
If Err.Number = 0 Then
WScript.Quit
Else
WshShell.RegWrite Verify & "McAfee Unistalled", 0,"REG_DWORD"
End If
On Error GoTo 0 'This turns on error handling
'******************************************************************************
WshShell.Run "msiexec /x {5DF3D1BB-894E-4DCD-8275-159AC9829B43} REMOVE=ALL REBOOT=R /q", 0, True
' Log date/time, user name, computer name, and IP address.
If objFSO.FolderExists(strShare) Then
On Error Resume Next
Set objLogFile = objFSO.OpenTextFile(strShare & "\" & strLogFile, 8, True, 0)
If Err.Number = 0 Then
' Make three attempts to write to log file.
intCount = 1
blnLog = False
Do Until intCount = 3
objLogFile.WriteLine "McAfee Unistalled ; " & Now & " ; " & strComputerName & " ; " & strUserName & " ; "
If Err.Number = 0 Then
intCount = 3
blnLog = True
Else
Err.Clear
intCount = intCount + 1
If Wscript.Version > 5 Then
Wscript.Sleep 200
End If
End If
Loop
On Error GoTo 0
If blnLog = False Then
strText = "Log cannot be written."
strText = strText & vbCrlf & "Another process may have the file open."
intConstants = vbOKOnly + vbExclamation
intAns = objShell.Popup(strText, intTimeout, strTitle, intConstants)
End If
objLogFile.Close
Else
On Error GoTo 0
strText = "Log cannot be written."
strText = strText & vbCrLf & "User may not have permissions,"
strText = strText & vbCrLf & "or log folder may not be shared."
intConstants = vbOKOnly + vbExclamation
intAns = objShell.Popup(strText, intTimeout, strTitle, intConstants)
End If
Set objLogFile = Nothing
End If