Escolar Documentos
Profissional Documentos
Cultura Documentos
==================================================================================
:: NOME : Remover Office
:: AUTOR : Ivo "Sir Ti_Rex" Dias
:: VERSION : 2.0.1
::
==================================================================================
:: Configura��es de tela.
::
/**********************************************************************************
**/
:mode
echo off
title Remover Office
color 2
goto permission
::
/**********************************************************************************
**/
goto :eof
::
/**********************************************************************************
**/
:: Termos.
::
/**********************************************************************************
***/
:terms
call :print Termos de uso.
echo.
echo.Um erro ocorreu.
echo.
echo.Aperte alguma tecla para continuar . . .
pause>nul
goto :eof
::
/**********************************************************************************
***/
:: Menu de ferramentas.
::
/**********************************************************************************
***/
:Menu
call :print Menu.
if %option% EQU 1 (
call :Registry
) else if %option% EQU 2 (
call :Office16
) else if %option% EQU 3 (
goto Close
) else (
echo.
echo.Opcao invalida.
echo.
echo.Aperte alguma tecla para continuar . . .
pause>nul
)
goto Menu
::
/**********************************************************************************
***/
:: ------------------------------------------------------------------------
:: Fazer backup do registro.
call :print Fazer backup do registro in: %USERPROFILE%\Desktop\Backup%now%.reg
if exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
echo.Um erro ocorreu.
echo.
echo. As alteracoes nao foram feitas no registro.
echo. Pode tentar novamente mais tarde.
echo.
echo.Aperte alguma tecla para continuar . . .
pause>nul
goto :eof
) else (
regedit /e "%USERPROFILE%\Desktop\Backup%now%.reg"
)
:: ------------------------------------------------------------------------
:: ------------------------------------------------------------------------
:: Verificando backup.
call :print Verificando backup.
::
/**********************************************************************************
***/
:: Remover Office.
::
/**********************************************************************************
***/
:Office16
:: --------------------------------------------------
:: Encerrando APPs.
call :print Microsoft Office, Internet Explorer e Windows Explorer precisam ser
encerrados.
:: --------------------------------------------------
:: Encerrando Office apps.
call :print Encerrando aplicativos do Office . . .
:: --------------------------------------------------
:: Encerrando tarefa Click-to-Run.
call :print Encerrando aplicativos do Office . . .
:: --------------------------------------------------
:: Encerrando outros apps.
call :print Encerrando aplicativos do Office . . .
:: --------------------------------------------------
:: Parando Office Source Engine.
call :print Parando o servico Office Source Engine . . .
:: --------------------------------------------------
:: Removendo arquivos do Office.
call :print Removendo arquivos do Office . . .
if exist "%PROGRAMDATA%\Microsoft\ClicToRun" (
takeown /f "%PROGRAMDATA%\Microsoft\ClicToRun"
attrib -r -s -h /s /d "%PROGRAMDATA%\Microsoft\ClicToRun"
rmdir /s /q "%PROGRAMDATA%\Microsoft\ClicToRun"
)
if exist "%PROGRAMDATA%\Microsoft\office\FFPackageLocker" (
takeown /f "%PROGRAMDATA%\Microsoft\office\FFPackageLocker"
attrib -r -s -h /s /d "%PROGRAMDATA%\Microsoft\office\FFPackageLocker"
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\FFPackageLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker" (
takeown /f "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker"
attrib -r -s -h /s /d "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker"
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker" (
takeown /f "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker"
attrib -r -s -h /s /d "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker"
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\Heartbeat" (
takeown /f "%PROGRAMDATA%\Microsoft\office\Heartbeat"
attrib -r -s -h /s /d "%PROGRAMDATA%\Microsoft\office\Heartbeat"
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\Heartbeat"
)
:: --------------------------------------------------
:: Removendo tarefas agendadas.
call :print Removendo tarefas agendadas . . .
:: --------------------------------------------------
:: Removendo servico Click-to-Run.
call :print Removendo servico Click-to-Run . . .
sc delete Clicktorunsvc
:: --------------------------------------------------
::Removendo arquivos de licenciamento
call :print Removendo arquivos de licenciamento . . .
MsiExec.exe /X{90160000-008F-0000-1000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0000-0000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0409-0000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-007E-0000-0000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0000-0000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0409-0000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-007E-0000-1000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0000-1000-0000000FF1CE} /quiet
MsiExec.exe /X{90160000-008C-0409-1000-0000000FF1CE} /quiet
MsiExec.exe /X{50150000-008F-0000-1000-0000000FF1CE} /quiet
MsiExec.exe /X{50150000-007E-0000-0000-0000000FF1CE} /quiet
MsiExec.exe /X{50150000-008C-0000-1000-0000000FF1CE} /quiet
:: --------------------------------------------------
:: Removendo chaves no Registro.
call :print Removendo chaves no Registro . . .
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifier
s\Microsoft SPFS Icon Overlay 1 (ErrorConflict)" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifier
s\Microsoft SPFS Icon Overlay 2 (SyncInProgress)" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifier
s\Microsoft SPFS Icon Overlay 3 (InSync)" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverl
ayIdentifiers\Microsoft SPFS Icon Overlay 1 (ErrorConflict)" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverl
ayIdentifiers\Microsoft SPFS Icon Overlay 2 (SyncInProgress)" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverl
ayIdentifiers\Microsoft SPFS Icon Overlay 3 (InSync)" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\
{0875DCB6-C686-4243-9432-ADCCF0B9F2D7}" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\Namespace\
{B28AA736-876B-46DA-B3A8-84C5E30BA492}" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NetworkNeighborhood\Namesp
ace\{46137B78-0EC3-426D-8B89-FF7C3A458B5E}" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Microsoft
Office Temp Files" /f
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=0FF1CE
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=O365
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=ProfessionaRetail
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=0FF1CE
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=O365
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=ProfessionalRetail
:: --------------------------------------------------
:: Removendo atalhos.
call :print Removendo atalhos . . .
cd /d "%PROGRAMFILES%\Microsoft\Windows\Start Menu\Programs"
takeown /f *2016.lnk
attrib -r -s -h /s /d *2016.lnk
del /s /f /q *2016.lnk
cd /d "%APPDATA%\Microsoft\Windows\Start Menu\Programs"
takeown /f *2016.lnk
attrib -r -s -h /s /d *2016.lnk
del /s /f /q *2016.lnk
cd /d "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"
takeown /f *2016.lnk
attrib -r -s -h /s /d *2016.lnk
del /s /f /q *2016.lnk
cd /d "%USERPROFILE%\Microsoft\Windows\Start Menu\Programs"
takeown /f *2016.lnk
attrib -r -s -h /s /d *2016.lnk
del /s /f /q *2016.lnk
:: --------------------------------------------------
:: Remover Resquicios
:: --------------------------------------------------
:: Removendo arquivos do Office.
call :print Removendo arquivos do Office . . .
if exist "%PROGRAMFILES%\Microsoft Office 15" (
rmdir /s /q "%PROGRAMFILES%\Microsoft Office 15"
) else if exist "%PROGRAMFILES(x86)%\Microsoft Office 15" (
rmdir /s /q "%PROGRAMFILES(x86)%\Microsoft Office 15"
)
if exist "%PROGRAMDATA%\Microsoft\ClicToRun" (
rmdir /s /q "%PROGRAMDATA%\Microsoft\ClicToRun"
)
if exist "%PROGRAMDATA%\Microsoft\office\FFPackageLocker" (
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\FFPackageLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker" (
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\ClickToRunPackageLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker" (
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\FFStatePBLocker"
)
if exist "%PROGRAMDATA%\Microsoft\office\Heartbeat" (
rmdir /s /q "%PROGRAMDATA%\Microsoft\office\Heartbeat"
)
if exist "%APPDATA%\microsoft\templates\Normal.dotm" (
del /s /q /f "%APPDATA%\microsoft\templates\Normal.dotm"
)
if exist "%APPDATA%\microsoft\templates\Word.dotx" (
del /s /q /f "%APPDATA%\microsoft\templates\Word.dotx"
)
if exist "%ALLUSERSPROFILE%\Microsoft\Office" (
rmdir /s /q "%ALLUSERSPROFILE%\Microsoft\Office"
)
if exist "%USERPROFILE%\Microsoft\Office" (
rmdir /s /q "%USERPROFILE%\Microsoft\Office"
)
:: --------------------------------------------------
if exist "%APPDATA%\Microsoft\Office" (
rmdir /s /q "%APPDATA%\Microsoft\Office"
)
if exist "%APPDATA%\Microsoft\Word" (
rmdir /s /q "%APPDATA%\Microsoft\Word"
)
if exist "%APPDATA%\Microsoft\Excel" (
rmdir /s /q "%APPDATA%\Microsoft\Excel"
)
if exist "%APPDATA%\Microsoft\Outlook" (
rmdir /s /q "%APPDATA%\Microsoft\Outlook"
)
if exist "%USERPROFILE%\AppData\Local\Microsoft\Office" (
rmdir /s /q "%USERPROFILE%\AppData\Local\Microsoft\Office"
)
if exist "%USERPROFILE%\AppData\Local\Microsoft\Word" (
rmdir /s /q "%USERPROFILE%\AppData\Local\Microsoft\Word"
)
if exist "%USERPROFILE%\AppData\Local\Microsoft\Excel" (
rmdir /s /q "%USERPROFILE%\AppData\Local\Microsoft\Excel"
)
if exist "%USERPROFILE%\AppData\Local\Microsoft\Outlook" (
rmdir /s /q "%USERPROFILE%\AppData\Local\Microsoft\Outlook"
)
:: --------------------------------------------------
:: Removendo arquivos temporarios do Windows.
call :print Removendo arquivos temporarios do Windows . . .
cd /d %TEMP%
del /s /f /q *.*
:: --------------------------------------------------
:: --------------------------------------------------
:: Removendo chaves no Registro.
call :print Removendo chaves no Registro . . .
set
clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\Delivery\SourceEngine\Downloads
set valor=0FF1CE}
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=0FF1CE
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=O365
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
set valor=ProfessionaRetail
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=0FF1CE
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=O365
set clave=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set valor=ProfessionalRetail
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ENTERPRISE" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ULTIMATE" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PRO" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PROPLUS" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ENTERPRISER" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ULTIMATER" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PROR"
/f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.HOMESTUDENTR" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.STANDARDR" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Office14.SMALLBUSINESSR"
/f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ENTERPRISE" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ULTIMATE" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PRO" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PROPLUS" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ENTERPRISER" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ULTIMATER" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PROR" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HOMESTUDENTR" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STANDARDR" /f
reg delete
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SMALLBUSINESSR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ENTE
RPRISE" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ULTI
MATE" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PRO"
/f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PROP
LUS" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ENTE
RPRISER" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.ULTI
MATER" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.PROR
" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.HOME
STUDENTR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.STAN
DARDR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Office14.SMAL
LBUSINESSR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ENTERPRISE" /
f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ULTIMATE" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PRO" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PROPLUS" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ENTERPRISER"
/f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ULTIMATER" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PROR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\HOMESTUDENTR"
/f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\STANDARDR" /f
reg delete
"HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\SMALLBUSINESS
R" /f
set clave=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-
18\Products
set valor=F01FEC
set clave=HKCR\Installer\Features
set valor=F01FEC
set clave=HKCR\Installer\Products
set valor=F01FEC
set clave=HKCR\Installer\UpgradeCodes
set valor=F01FEC
set clave=HKCR\Installer\Win32Assemblies
set valor=Office16
set clave=HKCR\Installer\Win32Assemblies
set valor=Office15
set clave=HKCR\Installer\Win32Assemblies
set valor=Office14
set clave=HKCR\Installer\Win32Assemblies
set valor=Office12
set clave=HKCR\Installer\Win32Assemblies
set valor=Office11
:: --------------------------------------------------
:: Encerrando.
call :print O procedimento foi completado com sucesso.
::
/**********************************************************************************
***/
:: Fim da ferramenta.
::
/**********************************************************************************
***/
:close
exit
::
/**********************************************************************************
***/