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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uninstall program from remote computer

Status
Not open for further replies.

cuner

Technical User
Apr 17, 2003
6
0
0
TR
hi
i want to uninstall all cracks and other illegal type programs on client machine how can i do it with vbscript any idea?
thanx
 
Pulled this out of a new scripting book...

I'm not sure if the uninstall method works remotely - if not, create a controller object to run the uninstall remotely.

gl :) -TAG

Code:
strComputer = "remotecomputername"
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
	("SELECT * FROM Win32_Product")
msgbox(colSoftware.count)
str = ""
For Each objSoftware in colSoftware
	'msgbox(objSoftware.Name)
	'If objSoftware.Name = "Napster" Then
	'	objSoftware.Uninstall()
	'End If
Next

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top