Sign in to follow this  
Followers 0
schilbiz

Converting VBS to Autoit - Citrix uninstall - reinstall

12 posts in this topic

Hey guys, I found these vbs on the Citrix support page, they unisntall old citrix client(s) then reinstall new client(s). They both work but I would like to see what they look like in Autoit. I plan on doing more install/uninstalls in the future and would like to use Autoit for them, this would help get a better idea on how they work.

The second is considerably larger in size and more thourough, but it seems like it could be shortened dramatically with Autoit.

I am working on the smaller one but don't have the ability to attempt the larger one, I will post it when I have it kinda working.

Thanks to anyone who has the time and/or helps!

On Error Resume Next
Set WSHShell = WScript.CreateObject("WScript.Shell")
strWinPath = WSHShell.ExpandEnvironmentStrings("%WinDir%")
'WScript.Echo strWinPath
WSHShell.Exec( strWinPath & "\system32\ctxsetup.exe /uninst C:\PROGRA~1\Citrix\icaweb32\uninst.inf" )
WScript.Sleep 1500
WSHShell.SendKeys "y"
WScript.Sleep 1500
WSHShell.SendKeys "{ENTER}"
WSHShell.Exec( "C:\WINDOWS\ISUNINST.EXE -fC:\PROGRA~1\Citrix\ICACLI~1\Uninst.isu -a -cC:\PROGRA~1\Citrix\ICACLI~1\uninstpn.dll" )
WScript.Sleep 5500
WSHShell.Exec( "msiexec.exe /I \\Servername\share\Citrix\10\ica32web.msi /qn")

==========================================================================

'==========================================================================
'
'
' NAME: Citrix EXE Web Client Remover for versions 7.1, 8.0, and 8.1)

'==========================================================================
On Error Resume Next
'
'
'
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
'
' If folder exists, execute program
'
If objFSO.FolderExists("C:\Program Files\Citrix\icaweb32") Then
'
' If client is not in use, remove it
'
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'wfica32.exe'")
If colProcesses.Count = 0 Then
'
' Delete client folders
' 
objFSO.DeleteFolder("C:\Program Files\Citrix\icaweb32") 
If Err <> 0 Then
SendEmail(" was not able to delete the client subdirectory.")
objShell.LogEvent 1, "Could not delete client subdirectory. Client was not uninstalled"
Else
objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")
'
' Delete files not in icaweb directory
'
objFSO.DeleteFile("C:\WINDOWS\system32\ctxsetup.exe")
objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en\ctxsetUI.dll")
'
' Delete Registry references
'
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SYSTEM\CURRENTCONTROLSET\SERVICES\AFD\PARAMETERS"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\METAFRAME PRESENTATION SERVER WEB CLIENT FOR WIN32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\Citrix Web Client"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\Citrix ICA Web Client"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\PREFETCHER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA\SHELL\OPEN\COMMAND"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA\SHELL\OPEN"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA\SHELL"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA\DEFAULTICON"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\WINFRAMEICA"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\HELPDIR"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\FLAGS"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\0"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=UTF-8"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=UTF8"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS950"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS949"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS936"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=ISO-8859-1"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=EUC-JP"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=UTF-8"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=UTF8"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS950"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS949"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS936"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=ISO-8859-1"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=EUC-JP"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\PROXYSTUBCLSID32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\PROXYSTUBCLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}\PROGRAMMABLE"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}\INPROCSERVER32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERSIONINDEPENDENTPROGID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERSION"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERB\0"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\TYPELIB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\TOOLBOXBITMAP32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\PROGRAMMABLE"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\PROGID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\MISCSTATUS\1"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\MISCSTATUS"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\INSERTABLE"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\INPROCSERVER32"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{7DD95802-9882-11CF-9FA9-00AA006C42C4}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{7DD95801-9882-11CF-9FA9-00AA006C42C4}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{40FC6ED4-2438-11CF-A3DB-080036F12502}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{40FC6ED3-2438-11CF-A3DB-080036F12502}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A57-2BAA-11CF-A229-00AA003D7352}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A53-2BAA-11CF-A229-00AA003D7352}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A52-2BAA-11CF-A229-00AA003D7352}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\CONTROL"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.3\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.3"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL\OPEN\COMMAND"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL\OPEN"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\INSERTABLE"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\DEFAULTICON"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1\CURVER"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1\CLSID"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT.2"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\CITRIX.ICACLIENT"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CLASSES\.ICA"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CITRIX\MUI"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CITRIX\CITRIXCAB"
objReg.DeleteKey HKEY_LOCAL_MACHINE, "SOFTWARE\CITRIX"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\NETSCAPE\NETSCAPE NAVIGATOR\VIEWERS"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\NETSCAPE\NETSCAPE NAVIGATOR\SUFFIXES"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU\EXE"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU\*"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\LASTVISITEDMRU"
objReg.DeleteKey HKEY_CURRENT_USER, "SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32"
objShell.LogEvent 0, "The Client was successfully uninstalled." 
End If
Else
SendEmail(" had the client running and could not uninstall it.")
objShell.LogEvent 1, "Could not uninstall the client because it was in use"
End If
Else
objShell.LogEvent 0, "There was not a client to uninstall." 
End If

Sub SendEmail(STR_Message)
Set colSettings = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each objComputer In colSettings
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "ICAClient@yourco.com"
objEmail.To = "you@yourco.com"
objEmail.Subject = "Error with Citrix Client Uninstall" 
objEmail.Textbody = "The Computer " & objComputer.Name & STR_Message
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.yourcompany.com" 
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send 
Next 

End Sub

Share this post


Link to post
Share on other sites



Hi.

With ~150 posts here you should have read the help file, right? :)

; strWinPath = WSHShell.ExpandEnvironmentStrings("%WinDir%")

@windir

; 'WScript.Echo strWinPath
msgbox() or ConsoleWrite()

; WSHShell.Exec( strWinPath & "\system32\ctxsetup.exe /uninst C:\PROGRA~1\Citrix\icaweb32\uninst.inf" )
runwait()

; WScript.Sleep 1500

sleep()

[snip]

... and so on. Try to convert to Autoit and post your AUTOIT code if you face issues...

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Some general rules:

1. Convert Set to Dim

2. Add dollar signs in front of all variables, arrays, and objects

3. Change End If to EndIf

4. Change Err to @ERROR

5. Wrap parameters for object functions with parentheses i.e. $obj.function("param", "param")

6. Change hex number identifier (&h) to (0x) ???

Share this post


Link to post
Share on other sites

Some general rules:

1. Convert Set to Dim

2. Add dollar signs in front of all variables, arrays, and objects

3. Change End If to EndIf

4. Change Err to @ERROR

5. Wrap parameters for object functions with parentheses i.e. $obj.function("param", "param")

6. Change hex number identifier (&h) to (0x) ???

Thanks, I will give those a try.

Share this post


Link to post
Share on other sites

Thanks, I will give those a try.

weaponx missed one

SendKeys to Send


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Okay, what about the Sub End/SendEmail and On Error Resume Next? And thanks for the help.

On Error Resume Next

Const HKEY_CURRENT_USER = 0x80000001
Const HKEY_LOCAL_MACHINE = 0x80000002
dim $objShell = $WScript.CreateObject("WScript.Shell")
dim $objFSO = $CreateObject("Scripting.FileSystemObject")
dim $objReg = $GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
dim $objWMIService = $GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

;If folder exists, execute program

If $objFSO.FolderExists("C:\Program Files\Citrix\icaweb32") Then

;If client is not in use, remove it

dim $colProcesses = $objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'wfica32.exe'")
If $colProcesses.Count = 0 Then

;Delete client folders
 
$objFSO.DeleteFolder("C:\Program Files\Citrix\icaweb32") 
If @ERROR <> 0 Then
SendEmail(" was not able to delete the client subdirectory.")
$objShell.LogEvent 1, "Could not delete client subdirectory. Client was not uninstalled"
Else
$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")

;Delete files not in icaweb directory

$objFSO.DeleteFile("C:\WINDOWS\system32\ctxsetup.exe")
$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en\ctxsetUI.dll")

;Delete Registry references

$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\AFD\PARAMETERS")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\METAFRAME PRESENTATION SERVER WEB CLIENT FOR WIN32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\Citrix Web Client")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL\Citrix ICA Web Client")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\PREFETCHER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA\SHELL\OPEN\COMMAND")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA\SHELL\OPEN")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA\SHELL")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA\DEFAULTICON")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\WINFRAMEICA")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\HELPDIR")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\FLAGS")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4\0")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}\2.4")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\TYPELIB\{238F6F80-B8B4-11CF-8771-00A024541EE3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=UTF-8")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=UTF8")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS950")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS949")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=MS936")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=ISO-8859-1")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA;CHARSET=EUC-JP")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=UTF-8")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=UTF8")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS950")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS949")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=MS936")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=ISO-8859-1")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA; CHARSET=EUC-JP")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MIME\DATABASE\CONTENT TYPE\APPLICATION/X-ICA")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{9B371833-5E4F-4B72-A8F6-CB8E762999F4}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8F2D9E63-D224-47E4-8111-32DBB016A4C6}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{8A5961DF-314E-4B7C-B57F-AAF35EA33079}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{785A16E9-4E42-4C87-84AD-BFB4A60570A3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4D5D2139-29E2-4CDC-8020-429B35999BE6}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{4A502C16-CFAE-4BB0-B1F9-93ACADDA57BB}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{49813E6D-17FF-41A1-9A7B-95C3D5B44185}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24FD31DB-3560-4C78-8950-30F03352D830}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{24013613-FF51-4B50-9832-37FA561594ED}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F82-B8B4-11CF-8771-00A024541EE3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{238F6F81-B8B4-11CF-8771-00A024541EE3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{17BFCA0A-C42E-4AC9-A693-29473FF9BA6C}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\PROXYSTUBCLSID32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}\PROXYSTUBCLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\INTERFACE\{02093274-7B69-4FEB-B7FD-3A010561A5F3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}\PROGRAMMABLE")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}\INPROCSERVER32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F85-B8B4-11CF-8771-00A024541EE3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERSIONINDEPENDENTPROGID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERSION")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERB\0")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\VERB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\TYPELIB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\TOOLBOXBITMAP32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\PROGRAMMABLE")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\PROGID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\MISCSTATUS\1")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\MISCSTATUS")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\INSERTABLE")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\INPROCSERVER32")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{7DD95802-9882-11CF-9FA9-00AA006C42C4}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{7DD95801-9882-11CF-9FA9-00AA006C42C4}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{40FC6ED4-2438-11CF-A3DB-080036F12502}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{40FC6ED3-2438-11CF-A3DB-080036F12502}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A57-2BAA-11CF-A229-00AA003D7352}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A53-2BAA-11CF-A229-00AA003D7352}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES\{0DE86A52-2BAA-11CF-A229-00AA003D7352}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\IMPLEMENTED CATEGORIES")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}\CONTROL")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{238F6F83-B8B4-11CF-8771-00A024541EE3}")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.3\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.3")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.2")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2.1")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP.2")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENTPROP")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL\OPEN\COMMAND")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL\OPEN")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\SHELL")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\INSERTABLE")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\DEFAULTICON")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.4")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.3")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.2")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1\CURVER")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1\CLSID")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2.1")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT.2")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CITRIX.ICACLIENT")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\.ICA")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CITRIX\MUI")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CITRIX\CITRIXCAB")
$objReg.DeleteKey ("HKEY_LOCAL_MACHINE\SOFTWARE\CITRIX")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\NETSCAPE\NETSCAPE NAVIGATOR\VIEWERS")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\NETSCAPE\NETSCAPE NAVIGATOR\SUFFIXES")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU\EXE")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU\*")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\OPENSAVEMRU")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32\LASTVISITEDMRU")
$objReg.DeleteKey ("HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\COMDLG32")

$objShell.LogEvent(0, "The Client was successfully uninstalled.")
EndIf
Else
SendEmail("had the client running and could not uninstall it.")
$objShell.LogEvent (1, "Could not uninstall the client because it was in use")
EndIf
Else
$objShell.LogEvent (0, "There was not a client to uninstall.")
EndIf

Sub SendEmail($STR_Message)
dim $colSettings = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each $objComputer In $colSettings
dim $objEmail = $CreateObject("CDO.Message")
$objEmail.From = ("ICAClient@yourco.com")
$objEmail.To = ("you@yourco.com")
$objEmail.Subject = ("Error with Citrix Client Uninstall" )
$objEmail.Textbody = ("The Computer") & $objComputer.Name & $STR_Message
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.yourcompany.com" 
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
$objEmail.Configuration.Fields.Update
$objEmail.Send 
Next 

End Sub

Share this post


Link to post
Share on other sites

And this stuff towards the bottom.

$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ;?
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.yourcompany.com" ;?
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ;?

Share this post


Link to post
Share on other sites

Something like this?

From:

Sub SendEmail($STR_Message)
dim $colSettings = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each $objComputer In $colSettings
dim $objEmail = $CreateObject("CDO.Message")
$objEmail.From = ("ICAClient@yourco.com")
$objEmail.To = ("you@yourco.com")
$objEmail.Subject = ("Error with Citrix Client Uninstall" )
$objEmail.Textbody = ("The Computer") & $objComputer.Name & $STR_Message
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.yourcompany.com" 
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
$objEmail.Configuration.Fields.Update
$objEmail.Send 
Next 
End SuboÝ÷ Ù:ºÚ"µÍ[ÈÙ[[XZ[
    ÌÍÔÕÓYÜØYÙJB[H  ÌÍØÛÛÙ][ÜÈH ÌÍÛØÓRTÙXÙK^XÔ]YJ   ][ÝÔÑSPÕ
ÓHÚ[ÌÐÛÛ]ÞÝ[I][ÝÊBÜXXÚ  ÌÍÛØÛÛ][  ÌÍØÛÛÙ][ÜÂ[H    ÌÍÛØ[XZ[H   ÌÍÐÜX]SØXÝ
    ][ÝÐÑËYÜØYÙI][ÝÊBÌÍÛØ[XZ[ÛHH
    ][ÝÒPÐPÛY[[ÝÛËÛÛI][ÝÊBÌÍÛØ[XZ[ÈH
    ][ÝÞ[ÝP[ÝÛËÛÛI][ÝÊBÌÍÛØ[XZ[ÝXXÝH
    ][ÝÑÜÚ]Ú]^ÛY[[[Ý[    ][ÝÊBÌÍÛØ[XZ[^ÙHH
    ][ÝÕHÛÛ]    [È ÌÍÛØÛÛ][YH    [È ÌÍÔÕÓYÜØYÙI][ÝÊBÌÍÛØ[XZ[ÛÛYÝ][ÛY[Ë][J    ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÙ[Ú[É][ÝÊHH
    ][ÝÌ][ÝÊBÌÍÛØ[XZ[ÛÛYÝ][ÛY[Ë][J ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]Ù][ÝÊHH
    ][ÝÜÛ][ÝÛÛ[KÛÛI][ÝÊBÌÍÛØ[XZ[ÛÛYÝ][ÛY[Ë][J    ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]ÙÜ   ][ÝÊHH
    ][ÝÌI][ÝÊBÌÍÛØ[XZ[ÛÛYÝ][ÛY[Ë]BÌÍÛØ[XZ[Ù[^[[

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

You almost got it. Sub..End Sub = Func...EndFunc, "For Each" is just "For", CreateObject is ObjCreate. No dollar signs on Obj* functions, only on actual objects.

Edited by weaponx

Share this post


Link to post
Share on other sites

You almost got it. Sub..End Sub = Func...EndFunc, "For Each" is just "For", CreateObject is ObjCreate. No dollar signs on Obj* functions, only on actual objects.

How about this now, it still doesn't quite work. Anything stand out as to why it will not work correctly? Thanks for the help.

I had to remove

dim $objShell = $WScript.CreateObject("WScript.Shell")oÝ÷ Úȧqí7éd®*mƧºw^Æ«yÛÚ®&æ§thm±ç¢¶ëvV­z¶­jYHr§çb¶ÚºÚ"µÍ[H ÌÍÛØÚ[HØÜX]J ][ÝÕÔØÜÚ[ ][ÝÊoÝ÷ Ù«­¢+Ù
½¹ÍÐÀÌØí!-e}
UII9Q}UMHôÁààÀÀÀÀÀÀÄ)
½¹ÍÐÀÌØí!-e}1=
1}5
!%9ôÁààÀÀÀÀÀÀÈ)¥´ÀÌØí½©M¡±°ô=©
ÉÑ ÅÕ½Ðí]MÉ¥ÁйM¡±°ÅÕ½Ðì¤)¥´ÀÌØí½©M

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

It mostly looks good. I see some problems with your $objReg object though. You must distinguish which options are variables and which are functions.

This looks like a function so its okay:

$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")

But this looks like a variable:

$objEmail.From = ("ICAClient@yourco.com")

So it should be:

$objEmail.From = "ICAClient@yourco.com"

Parantheses only go around object function parameters.

You could always switch to native AutoIt functions instead of WMI queries...the following are equal:

If $objFSO.FolderExists("C:\Program Files\Citrix\icaweb32") Then
 
 If FileExists("C:\Program Files\Citrix\icaweb32") Then

Dim $colProcesses = $objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'wfica32.exe'")
 
 ProcessExists('wfica32.exe')

$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")
 
 DirRemove("C:\WINDOWS\system32\Resource\en")

$objReg.DeleteKey("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS")
 
 RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS")

Func SendEmail($STR_Message) ....
 
 #include <INet.au3>
 _INetMail()
 _INetSmtpMail
Edited by weaponx

Share this post


Link to post
Share on other sites

It mostly looks good. I see some problems with your $objReg object though. You must distinguish which options are variables and which are functions.

This looks like a function so its okay:

$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")

But this looks like a variable:

$objEmail.From = ("ICAClient@yourco.com")

So it should be:

$objEmail.From = "ICAClient@yourco.com"

Parantheses only go around object function parameters.

You could always switch to native AutoIt functions instead of WMI queries...the following are equal:

If $objFSO.FolderExists("C:\Program Files\Citrix\icaweb32") Then
 
 If FileExists("C:\Program Files\Citrix\icaweb32") Then

Dim $colProcesses = $objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'wfica32.exe'")
 
 ProcessExists('wfica32.exe')

$objFSO.DeleteFile("C:\WINDOWS\system32\Resource\en")
 
 DirRemove("C:\WINDOWS\system32\Resource\en")

$objReg.DeleteKey("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS")
 
 RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\SERVICES\TCPIP\PARAMETERS")

Func SendEmail($STR_Message) ....
 
 #include <INet.au3>
 _INetMail()
 _INetSmtpMail

Thanks for all the help weaponx, you have always offered good information and generaly have been very helpful. I appreciate it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0