OK
Here goes
I adapted CJ's script to uninstall the applications via the reg settings, however, with the profile for the computer being mandatory, when the user installs applications the reg settings are lost when they log out.
So I setup the script to look for the program directory and remove it. Simple.
Here's CJ's script..
code:
; Uninstall Utility for Win32
; by cj
;
; This program reads the Uninstall information from the Registry and
; allows you to select a program to be uninstalled.
;
; Be careful and enjoy!
;
; cj
;
dim $programs[100] ; increase this if you have more than 100 installed apps
$base="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$loud="UninstallString"
$quiet="QuietUninstallString"
$runstring=""
$disp=0
color w+/n "Unstallable Programs:" color w/n
$indexQ=0
while @error=0
$indexQ=$indexQ+1
$program=enumkey($base, $indexQ) ; get the next installed program's name
$=readvalue("$base\$program", $quiet) ; does it have the Quiet Uninstall?
if @error=0 ; YES
$disp=$disp+1 ? if $disp<10 " " endif
"$disp - Quiet Uninstall: $program"
$programs[$disp]="$program" ; store its name for later
endif
$=readvalue("$base\$program", $loud) ; Does it have the loud install?
if @error=0 ; YES
$disp=$disp+1 ? if $disp<10 " " endif
"$disp - "
$programs[$disp]=$program ; store its name for later
readvalue("$base\$program", "DisplayName") ; and display the Full name
endif
; this restores @error to 0 so that a failure to find the UninstallString
; value does not prematurely end the EnumKey loop
$=enumkey($base, $indexQ)
loop
? ? "Enter the number of the program you wish to Uninstall or Q to Quit : "
gets $which
if $which="Q" ? ? "That was close..." ? exit endif
? ?
$choice=$programs[$which]
"You chose : " readvalue("$base\$choice", "DisplayName")
if @error<>0 "$choice" endif
? ? "Are you sure ?"
get $yn
if $yn="n" ? ? "That was close..." ? exit endif
Toast app
$runstring=readvalue("$base\$choice", $quiet)
if @error<>0 $runstring=readvalue("$base\$choice", $loud) endif
;? ? "Running: $runstring" ? ; Uncomment this line and comment the next one
shell "%comspec% /c $runstring" ; if you want to see what would happen without it happening...
? ? "All done, thanks" ?
Here's a sample of the remove directory script..
code:
;Uninstall Winamp
$LongKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\winamp\"
$exist = existkey($Longkey)
if $exist = 0
" Winamp Found.. Removing..."
$UninstallStr = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\winamp","UninstallString")
SHELL $UninstallStr + " -A"
"Complete." ?
else
" Winamp Not installed." ?
endif
;Remove Winamp Directory
IF (EXIST ("C:\Program Files\winamp") = "1")
" Winamp Folder Found...Removing..."
cd "C:\Program Files\winamp"
del "*.*"
cd ".."
rd "winamp"
"Done." ?
endif
Let me know if you need any more help.