Naveed Posted August 2, 2010 Share Posted August 2, 2010 Hi, I use the below code in vbs to remotely uninstall applications, however i would like to use autoit to do this. I have had a look at scriptomatic and that only shows me how to check for installed applications Here is the VB code: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product " _ & "Where Name = 'Personnel database'") For Each objSoftware in colSoftware objSoftware.Uninstall() Next I can convert all of it except for the "where name = 'software name'" part?? Any help would be much appreciated. Thanks Link to comment Share on other sites More sharing options...
LurchMan Posted August 2, 2010 Share Posted August 2, 2010 All you needed to do is add some $'s and change some functions.. $strComputer = "." $objWMIService = ObjGet("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $strComputer & "\root\cimv2") $colSoftware = $objWMIService.ExecQuery _ ("Select * from Win32_Product " _ & "Where Name = 'Personnel database'") For $objSoftware in $colSoftware $objSoftware.Uninstall() Next Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now