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

Unattended Uninstall Batch File

Status
Not open for further replies.
Feb 27, 2008
32
CA
Good Day Everyone,

I have found out that there are about 400 PC's in my organization that have non licensed Winzip 8.1. I've created a batch file that I am looking at sending out through SMS.

The batch file goes through and removes the application from the registry and start menu but for some reason the Program Files\Winzip folder is still there.

Below is the command I am running;

' Uninstall WinZip

rem remove winzip
C:\PROGRA~1\WinZip\winzip32.exe /uninstallx /s


On Error Resume Next
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

main()


sub main()

'Let's find out where WinZip is installed

WZPath=regget("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
App Paths\winzip32.exe\")

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run WZPath & " /uninstallx",0,TRUE

FullWZPath = replace(WZPath, "PROGRA~1", "Program Files")

DeleteAFolder(left(FullWZPath,(len(FullWZPath)-13)))

end sub


function regget(value)
on error resume next
Set regedit = CreateObject("WScript.Shell")
regget=regedit.RegRead(value)
end function

function DeleteAFolder(filespec)
Dim fso
on error resume next
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(filespec)
end function

Any help would be greatly appreciated.

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top