Computing.Net > Forums > Programming > Batch file uninstall file list

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file uninstall file list

Reply to Message Icon

Name: phillik747
Date: May 19, 2005 at 15:34:55 Pacific
OS: xp
CPU/Ram: amd 64/1gb
Comment:

Hello all and thank you for reading my post. I have a question about a batch file. I have a batch file that will uninstall certain programs by selection. I work on people's computers and most of my work is uninstalling spyware. I install tools like ad-aware, spybot, spysweeper, etc. When I’m done working on their computers I run my batch file to uninstall my tools. My problem is I would like the batch file to automatically see if the customer already had ad-aware or spybot installed by looking at the date modified and run the uninstaller if the program was installed less than a week ago. Here is an example of my batch file below:

@ECHO OFF
CLS
:LOOP
ECHO A. Uninstall Ad-aware
ECHO B. Uninstall SpyBot
ECHO C. Uninstall Spysweeper
ECHO D. Uninstall MS AnitSpyware
ECHO E. Uninstall GIANT
ECHO F. Uninstall Crap Cleaner
ECHO G. Uninstall Avast
ECHO Q. Quit
ECHO.
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the letter and press Enter:
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='A' GOTO Ad-Aware
IF /I '%Choice%'=='B' GOTO SpyBot
IF /I '%Choice%'=='C' GOTO SpySweeper
IF /I '%Choice%'=='D' GOTO MSAnitSpy
IF /I '%Choice%'=='E' GOTO GIANT
IF /I '%Choice%'=='F' GOTO CCLEANER
IF /I '%Choice%'=='G' GOTO avast
IF /I '%Choice%'=='Q' GOTO End
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO again

:Ad-Aware
C:
echo Uninstalling Ad-Aware...
if exist "c:\program files\lavasoft\ad-aware se personal\Ad-Aware.exe" goto filefound
echo.
echo Ad-Aware not installed
goto again
:filefound
CD "C:\Program Files\Lavasoft\Ad-Aware SE Personal"
UNWISE.EXE /S
CD "C:\PROGRAM FILES"
RD /S /Q LAVASOFT
echo Ad-Aware uninstalled
GOTO Again

:Again
PAUSE
CLS
GOTO Loop
:End



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 19, 2005 at 21:50:58 Pacific
Reply:

What is the question?

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: phillik747
Date: May 20, 2005 at 06:58:53 Pacific
Reply:

I would like to have to batch file look to see when the program was installed ie: look and the date modified on the .exe file. If the program was installed less than a week ago, goto uninstall program. I guess my question is, what command do I need to use to do this?

Thank you M2 for the help,
Kyle


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file uninstall file list

list batch files larger that 0kb www.computing.net/answers/programming/list-batch-files-larger-that-0kb/16430.html

Remotely Run Batch File from List www.computing.net/answers/programming/remotely-run-batch-file-from-list/17266.html

Batch file to list dir name www.computing.net/answers/programming/batch-file-to-list-dir-name-/17362.html