Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uninstall PCAnywhere from WinXP workstations

Status
Not open for further replies.

eugene2

IS-IT--Management
Apr 2, 2001
43
US
Is there a way to uninstall PCAnywhere from around 300 workstations without hand touching every workstation. I was looking for a possible script that may work. Thanks
 
Can you initiate and uninstall froma command line? If so then yes, you can do it via script by automating that proces. Here is a simpel example that does a DIR C:\ command. Just substitute your uninstall command as needed.

Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run ("CMD.EXE /K DIR C:\")

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Goto HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall

See if you can find the uninstall string for PC Anywhere
Go to the command prompt and check if it has switches

Here is one I created to remove mcafee and log the computers.

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
[\code]
 
Goto HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall

See if you can find the uninstall string for PC Anywhere
Go to the command prompt and check if it has switches

Here is one I created to remove mcafee and log the computers.

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
 
Thank you for your help. I will try it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top