jeudi 27 décembre 2018

Uninstall batch file not working Closes out

have the below file.

My end goal is to check for a file in a directory if this file exists don't do anything

if the file does not exist uninstall teamviewer on that pc

Here's the below script

IF EXIST C:\store\TV-DONOTDELETE.TXT

(echo Found the file won't do anything.)
pause

ELSE
(
REM Kill TeamViewer Process
taskkill /f /im teamviewer*
REM Remove Older Versions
for /d %%F in ("C:\Program Files\TeamViewer\*") do "%%F\uninstall.exe" /S
for /d %%F in ("C:\Program Files (x86)\TeamViewer\*") do "%%F\uninstall.exe" /S
REM Remove Newer Versions
"C:\Program Files\TeamViewer\uninstall.exe" /S
"C:\Program Files (x86)\TeamViewer\uninstall.exe" /S

echo removed teamviewer you can thank me later
)
pause

Aucun commentaire:

Enregistrer un commentaire