Trying to remove acces 97...can someone help me...I suck at scripting ><
I would also like it to do it over a network if possible...I had a box before to pop up and ask for the host name, but i cant even get it work locally. Any help would be appreciated.
Set FileSysObj = CreateObject("Scripting.FileSystemObject") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product Where Name = 'Access'") For Each objSoftware in colSoftware wscript.echo objSoftware.Name wscript.echo objSoftware.version objSoftware.Uninstall() wscript.echo "Access has been removed Successfully!" Next
On one of the computers look under HKLM/Software/Microsoft/Windows/CurrentVersion/Uninstall and see if Access 97 is listed. You will have to go through each folder and look at Display Name. Once you find it the look at UninstallString something like MsiExec.exe /I{0EFDF2F9-836D-4EB7-A32D-038BD3F1FB2A}. Write a batch file with computer names in it and the uninstall string. Will look like what is below. Download PSTools (it helps me everyday) and use psexec.exe.
or you could use with a text document named softwaregone and list all computer names. Replace 'Symantec Antivirus 10.0.2011.2' with the exact name of the software.
On Error Resume Next softwaregone = wscript.arguments(0) set onet = createobject("wscript.network") set ofs = createobject("scripting.filesystemobject") set oipFile = ofs.opentextfile(softwaregone, 1, false) if (Err.Number <> 0) then wscript.echo "Cannot open " & ipFile
else while not oipFile.atEndOfStream strComputer = oipFile.ReadLine() wscript.echo vbCrLf & "Connecting to " & strComputer & "..." Set objService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") if (Err.Number <> 0) then wscript.echo "Failed to connect to " & strComputer & "." On error resume next else Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _ ("Select * from Win32_Product Where Name = 'Symantec Antivirus 10.0.2011.2'") For Each objSoftware in colSoftware objSoftware.Uninstall() Next End If wend End If
ok i think i got it....error on my part. I redid some code and thats why...Ill see if it works now...it said it was connecting to a network pc so i will see if it deletes it
Microsoft Access 97 is the display name....So I put my hostname in the txt file, it says it connects, i give it time but the software doesnt get removed
Download PSTools from sysinternals and run the psinfo -s on your computer and that will give you the exact name it is looking for. If you look at the script I used for Symantec it has 2011.2 even though it shows in Add/Remove and just 2011.
I dont have Access 97 so I really cant test the script. I know it has worked on everything from Java to Symantec. You may want to use the batch file with msiexec /x. Sorry.