Taking batch files to the next level, I have created a remote uninstaller for most any version of Realplayer, and I just have to show it off (at least until some joker comes along and tells me how I could have done it 10x easier).
It started off innocently enough, run the uninstaller on the remote system with RCMD (I can't use PSTOOLS, my workplace limits me to microsoft-written utilities ONLY), etc, etc. Apparently it can't be run silently. It actually uninstalls the application and then presents the user with a box to click OK, waiting for this OK before removing r1puninst.exe, the uninstaller application. This totally hangs up the RCMD application until I kill the process on the host machine. So what do I do? I write another batch file (monitor.bat) that gets STARTed just before I run the RCMD sequence that goes:
:START
IF NOT EXIST "R:\Program Files\Real" (
RKILL /nkill \\%1 r1puninst.exe
EXIT
) ELSE (
SLEEP.EXE 10
GOTO START
)
It works! I used a bunch of windows resource kit utils for this one:
SC.EXE
RCMDSVC.EXE
RCMD.EXE
RKILL.EXE
RKILLSRV.EXE
SLEEP.BAT
Here's the main batch file (real.bat), it uses a single-column list of computer names called "names":
IF EXIST R: NET USE R: /DELETE
FOR /F "eol=" %%i in (names.txt) do call :REAL %%i
GOTO :EOF
:REAL
PING %1 -n 1
IF %ERRORLEVEL% NEQ 0 (
ECHO %1 REAL >>NO_PING.TXT
GOTO :EOF
)
NET USE R: \\%1\C$
IF %ERRORLEVEL% NEQ 0 (
ECHO %1 REAL >>BADPERMS.TXT
GOTO :EOF
)
IF NOT EXIST "R:\Program Files\Real\Realplayer\realplay.exe" (
ECHO %1 REAL >>NOTHERE.TXT
NET USE R: /DELETE
GOTO :EOF
)
RKILL /INSTALL \\%1
START MONITOR.BAT %1
COPY RCMDSVC.EXE R:\
SC \\%1 CREATE RCMDSVC BINPATH= C:\RCMDSVC.EXE
SC \\%1 START RCMDSVC
RCMD \\%1 "C:\Progra~1\Common~1\Real\Update_OB\r1puninst.exe" -all -noask
SC \\%1 STOP RCMDSVC
SC \\%1 DELETE RCMDSVC
DEL R:\RCMDSVC.EXE
RKILL /deinstall \\%1
REM Sometimes the rkill deinstaller tries to delete rkillsrv.exe before the service is completely dead
SLEEP 10
IF EXIST R:\WINNT\SYSTEM32\RKILLSRV.EXE DEL R:\WINNT\SYSTEM32\RKILLSRV.EXE
IF EXIST R:\WINDOWS\SYSTEM32\RKILLSRV.EXE DEL R:\WINDOWS\SYSTEM32\RKILLSRV.EXE
IF EXIST "R:\Program Files\Real" (
ECHO %1 REAL >>BADUNINST.TXT
NET USE R: /DELETE
GOTO :EOF
)
RMDIR "R:\Program Files\Common Files\Real" /s /q
ECHO %1 REAL >>COMPLETE.TXT
NET USE R: /DELETE
GOTO :EOF
YEAH!!!
Page 1 of 1
Remote Realplayer Uninstall Just thought I'd share
- ← [Release] Winampv5.34 Build 1195 Beta + AutoitScript
- Application Installs
- Bootstrap for Visual Basic Setup Toolkit →
Share this topic:
Page 1 of 1



Help
Back to top








