J
Joseph
I am using code I copy/pasted from the scrip center help file,
but the few lines below don't cut much mustard at all, it seems to
consider the request and then go to each name/software in
turnn and do nothing at all!
I am trying to automate the removal of unwanted software on clients'
machines and
love to get it to work.
Pointers to solution would be great, thank you all.
TIA
' These are the Names of Software I want to remove
' and as they appear in Control Panel -> Add/Remove Softyware:
Dim ArrOfProcessesToTerminate, strTargetProcToTerminate
ArrOfProcessesToTerminate = Array("iTunes","AdminScriptEditor TRIAL
EDITION","Clipomatic", _
"TheVoiceDot_Setup")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
For Each strTargetProcToTerminate In ArrOfProcessesToTerminate
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = '" &
strTargetProcToTerminate & "'")
For Each oProcess in colProcessList
wscript.popup "oProcess: " & ThisOne _
Chr(13) & "oProcess.InstallDate: " & oProcess.InstallDate _
Chr(13) & "oProcess.InstallLocation: " &
oProcess.InstallLocation _
Chr(13) & "oProcess.Name: " & oProcess.Name _
Chr(13) & "oProcess.Description: " & oProcess.Description
oProcess.Uninstall()
Next 'For Each oProcess In colProcesses
Next 'For Each strTargetProc In arrTargetProcs
but the few lines below don't cut much mustard at all, it seems to
consider the request and then go to each name/software in
turnn and do nothing at all!
I am trying to automate the removal of unwanted software on clients'
machines and
love to get it to work.
Pointers to solution would be great, thank you all.
TIA
' These are the Names of Software I want to remove
' and as they appear in Control Panel -> Add/Remove Softyware:
Dim ArrOfProcessesToTerminate, strTargetProcToTerminate
ArrOfProcessesToTerminate = Array("iTunes","AdminScriptEditor TRIAL
EDITION","Clipomatic", _
"TheVoiceDot_Setup")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
For Each strTargetProcToTerminate In ArrOfProcessesToTerminate
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = '" &
strTargetProcToTerminate & "'")
For Each oProcess in colProcessList
wscript.popup "oProcess: " & ThisOne _
Chr(13) & "oProcess.InstallDate: " & oProcess.InstallDate _
Chr(13) & "oProcess.InstallLocation: " &
oProcess.InstallLocation _
Chr(13) & "oProcess.Name: " & oProcess.Name _
Chr(13) & "oProcess.Description: " & oProcess.Description
oProcess.Uninstall()
Next 'For Each oProcess In colProcesses
Next 'For Each strTargetProc In arrTargetProcs