1.

Solve : Help with Batch Command File?

Answer»

Hey guys just a beginner here and trying to simply my life and few others.

I have succesfully made a install batch file and now im working on the Uninstall portion to help make things easier.

I have most of this complete and im stuck on just the ONE portion. Im stuck on the portion where the uninstall string has to be made from a CMD prompt. Im not sure how to make that call. To open the prompt to type in the command etc.

Here is what i have so far and to give you a idea of what im trying to do

Code: [Select]Echo ***************************************************************
Echo * *** Custom Uninstall Menu for IT Only ***           
Echo *
Echo * To Uninstall McAfee Site Advisor, Choose A
Echo *
Echo * To Uninstall Host Intrusion Protection Services, Choose B
Echo *
Echo * To Uninstall McAfee Anti SPYWARE, Choose C
Echo *
Echo * To Uninstall McAfee Virus Scan Enterprise, Choose D
Echo *
Echo * To Uninstall McAfee File Folder Encryption,choose E
Echo *
Echo * To Uninstall McAfee ePO Frame Package, Choose F
Echo *
Echo * To Exit, Choose X            
Echo *
Echo ****************************************************************
Echo:
choice /C abcdefx /m "Please Make your Selection from the Above Options"

IF ERRORLEVEL 7 goto x
IF ERRORLEVEL 6 goto F
IF ERRORLEVEL 5 goto E
IF ERRORLEVEL 4 goto D
IF ERRORLEVEL 3 goto c
IF ERRORLEVEL 2 goto B
IF ERRORLEVEL 1 goto A

:A
call MsiExec.exe /X{00FC3F65-86EB-475E-881F-A5B1CF731320} REMOVE=ALL
cls
goto menu

:B
call MsiExec.exe /X{B332732A-4958-41DD-B439-DDA2D32753C5} REMOVE=ALL
cls
goto menu

:C
call C:\Program Files\McAfee\VirusScan Enterprise\scan32.exe /UninstallMAS
cls
goto menu

:D
call msiexec /x {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} REMOVE=ALL
cls
goto menu
:E
call C:\Program Files\McAfee\Endpoint Encryption for Files and Folders\SbCeSetup -Uninstall -Confirm "-AppName:McAfee Endpoint Encryption for Files and Folders"
cls
goto menu

:F
call MsiExec.exe /X{362678B4-6ED5-46E9-A6B2-53EF22159151} REMOVE=ALL
cls
goto menu

:X
:exit
cls
echo This Utility will now exit
pauseREM cmd will open a new command window
Rem or  "start  program"  will open a new command window provided
Rem the path to program is correct


C:\batch>type neo.bat
echo off

:menu
Echo * *** Custom Uninstall Menu for IT Only ***

Echo A) To Uninstall McAfee Site Advisor

Echo B) To Uninstall Host Intrusion Protection Services

Echo C) To Uninstall McAfee Anti Spyware

Echo D) To Uninstall McAfee Virus Scan Enterprise

Echo E) To Uninstall McAfee File Folder Encryption

Echo F) To Uninstall McAfee ePO Frame Package

Echo X) To Exit


Echo :choice /C abcdefx
SET /p Option=Choice:
echo Option =%Option%
pause

if %Option%==A   goto A
if %Option%==B GOTO B
if %Option%==C GOTO C
if %Option%==D GOTO D
if %Option%==E GOTO E
if %Option%==F GOTO F
if %Option%==X GOTO X
Goto menu

rem IF ERRORLEVEL 7 goto x
rem IF ERRORLEVEL 6 goto F
rem IF ERRORLEVEL 5 goto E
rem IF ERRORLEVEL 4 goto D
rem IF ERRORLEVEL 3 goto C
rem IF ERRORLEVEL 2 goto B
rem IF ERRORLEVEL 1 goto A

:A
C:\WINDOWS\system32\MsiExec.exe /X{00FC3F65-86EB-475E-881F-A5B1CF731320} REMOVE=
ALL
echo inside A
pause
cls
goto menu

:B
C:\WINDOWS\system32\MsiExec.exe /X{B332732A-4958-41DD-B439-DDA2D32753C5} REMOVE=
ALL
echo inside B
pause
cls
goto menu

:C
echo inside C
"C:\Program Files\McAfee\VirusScan Enterprise\scan32.exe" /UninstallMAS
echo inside C
pause
cls
goto menu



C:\WINDOWS\system32\MsiExec.exe /x {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} REMOVE
=ALL
echo inside D
pause
cls
goto menu
:E
"C:\Program Files\McAfee\Endpoint Encryption for Files and Folders\SbCeSetup" -U
ninstall -Confirm "-AppName:McAfee Endpoint Encryption for Files and Folders"
echo inside E
pause
cls
goto menu

:F
C:\WINDOWS\system32\MsiExec.exe /X{362678B4-6ED5-46E9-A6B2-53EF22159151} REMOVE=
ALL
echo inside F
pause
cls
goto menu

:X
echo inside X
echo Bye
pause
:exit
pause
echo inside exit
echo This Utility will now exit
pause

Output:


C:\batch>neo.bat
* *** Custom Uninstall Menu for IT Only ***
A) To Uninstall McAfee Site Advisor
B) To Uninstall Host Intrusion Protection Services
C) To Uninstall McAfee Anti Spyware
D) To Uninstall McAfee Virus Scan Enterprise
E) To Uninstall McAfee File Folder Encryption
F) To Uninstall McAfee ePO Frame Package
X) To Exit
:choice  abcdefx
Choice:



Discussion

No Comment Found