#66131 - 2002-06-06 01:58 AM
Re: Removing Webshots!?
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Well Dave, The Docs in the house and was feeling sorry for you so I wrote this script for you.
Then you go and post you're running KiXtart v3.63
Sorry, but I wrote this code to work with v4.02
Don't despair too much though, as it can easily be converted to work with v3.63
The KEYEXIST can be modified to EXISTKEY and the variable $xa=LEFT will need to be modified to find only the first 3 characters of the installed drive letter. i.e. C:\ or D:\ or E:\ etc...
WARNING!! The Surgeon General has determined that Schnapps Shots are better then WebShots so take a shot of Schnapps and then start working on this perscription of code.
NOTE: Don't forget to get the PrcView program and modify the code to copy somewhere on your local machines where users have the right to write.
code:
;** RemoveWebShots.kix ;** v1.0 Only tested on Windows 2000 ;** NOTE: Wallpaper and Screensaver are not reset on Win9x ;** You need to edit WIN.INI and SYSTEM.INI files to alter those settings on Win9x and this script does not do that. ;** This script works with KiXtart v4.02 and removes the WebShots program ;** Written By NTDOC 06/05/2002 ;** Webshots Home Page: http://www.webshots.com ;** Script requires PrcView and KiXtart v4.02 ;** PrcView is a process viewer utility that displays detailed information about processes running under Windows ;** Location to get a copy of PrcView is: http://www.xmlsp.com/pview/prcview.htm ;** Modify code so that PV.EXE and PSAPI.DLL is copied from your server to the local Workstation. ;** PSAPI.DLL is only needed for Windows NT/2000 systems, not for Windows 9x systems.
BREAK ON ;rem out this line to prevent user from terminating the script. $ProgramFiles=READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") IF EXIST("$ProgramFiles\Webshots\WebshotsTray.exe") $WebShotActive=1 GOSUB "STOPSHOT" GOSUB "REMOVE" RETURN ENDIF RETURN
:STOPSHOT
$StartMenu=READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Start Menu") $StartUpFolder=READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Startup") $DeskTop=READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Desktop") $CurrentSaver=READVALUE("HKEY_CURRENT_USER\Control Panel\Desktop", "SCRNSAVE.EXE") $CurrentWallpaper=READVALUE("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") $StartValue="HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" $CurrentWebPage=READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page") $DefaultWebPage="http://www.google.com" ; URL you want the user's home page set to after the removal" $WebShotFullURL="http://www.webshots.com/r/internal/start/client/RAND" $WebShotPage="http://www.webshots.com" $EndWebShots = '%windir%\pv.exe -k -f WebshotsTray.exe' $xa=LEFT($ProgramFiles, 3) $xb= $xa +"PROGRA~1\Webshots\Swebexec.exe" IF @INWIN=1 $SSName="%windir%\system32\ssmyst.scr" $BitMap="%windir%\Soap Bubbles.bmp" $NewSaver=WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop", "SCRNSAVE.EXE", "$SSName", "REG_SZ") $DefaultWallpaper=WRITEVALUE("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper", "$BitMap", "REG_SZ") ENDIF IF INSTR(READVALUE($StartValue,"Start Page"),$WebShotPage) $x=WRITEVALUE($StartValue,"Start Page", "$DefaultWebPage", "REG_SZ") ENDIF
SELECT CASE @INWIN=2 IF (EXIST("%WINDIR%\PV.EXE") = 0) COPY "C:\PVIEW\PV.EXE" %WINDIR% ENDIF IF $WebShotActive SHELL $EndWebShots ENDIF CASE @INWIN=1 IF INGROUP("\\@WKSTA\Administrators")<>0 ; Verifies user is an Administrator on the system IF (EXIST("%WINDIR%\PV.EXE") = 0) COPY "C:\PVIEW\PV.EXE" %WINDIR% IF (EXIST("%WINDIR%\PSAPI.DLL")= 0) COPY "C:\PVIEW\PSAPI.DLL" %WINDIR% ENDIF ENDIF IF $WebShotActive SHELL $EndWebShots ENDIF ELSE ; abort out, user is not a local admin. Can't remove with this account. Add code to log if you want to. RETURN ENDIF ENDSELECT RETURN
:REMOVE $x=DELTREE("HKEY_CURRENT_USER\Software\Webshots") $x=DELTREE("HKEY_CLASSES_ROOT\.wbc") $x=DELTREE("HKEY_CLASSES_ROOT\.wbp") $x=DELTREE("HKEY_CLASSES_ROOT\.wbz") $x=DELTREE("HKEY_CLASSES_ROOT\wbc_auto_file") $x=DELTREE("HKEY_CLASSES_ROOT\Webshots.Collection") $x=DELTREE("HKEY_CLASSES_ROOT\Webshots.Extension") $x=DELTREE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Webshots") $x=DELVALUE("HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\User Trusted External Applications", "$xb") $x=DELVALUE("HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\Viewers", "application/x-webshots")
IF @INWIN=1 $RemoveFiles='%comspec% /c RD /S /Q "$ProgramFiles\Webshots"' $RemoveTemp='%comspec% /c RD /S /Q "%temp%\WebshotsTemp"' $RemoveWSMenu='%comspec% /c RD /S /Q "$StartMenu\Programs\Webshots Desktop!"' ELSE $RemoveFiles='%comspec% /c %WINDIR%\COMMAND\DELTREE /Y "$ProgramFiles\Webshots" ' $RemoveTemp='%comspec% /c %WINDIR%\COMMAND\DELTREE /Y "%temp%\WebshotsTemp" ' $RemoveWSMenu='%comspec% /c %WINDIR%\COMMAND\DELTREE /Y "$StartMenu\Programs\Webshots Desktop!" ' ENDIF SHELL "$RemoveFiles >nul 2>nul" SHELL "$RemoveTemp >nul 2>nul" SHELL "$RemoveWSMenu >nul 2>nul" DEL "$Desktop\Webshots Desktop!.lnk" DEL "$StartUpFolder\Webshots.lnk" DEL "%WINDIR%\WEBSHOT*.BMP" DEL "%WINDIR%\Webshots.scr" DEL "%WINDIR%\Webshots.ini" DEL "%WINDIR%\WebshotsForAdministrator.bmp" DEL "%WINDIR%\WebshotsUninstall.exe" RETURN
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2011 anonymous users online.
|
|
|