Thursday, September 7, 2017

Batch file to wipe the SCCM client on the machine

Below is the batch file to wipe the SCCM client on the machine



@echo off
echo Please Wait while the system is uninstalling Microsoft's SMS/SCCM Client.

echo Checking for SCCM 2007 client...
IF EXIST %windir%\System32\ccmsetup\ccmsetup.exe GOTO DEL07
echo No SCCM 2007 client found.

echo Checking for SCCM client in 64bit...
IF EXIST %windir%\ccmsetup\ccmsetup.exe GOTO DEL12
echo No SCCM 2012 client found.

echo Checking for SMSCFG file...
IF EXIST %windir%\SMSCFG.INI GOTO DELINI
echo No SMSCFG file found.
echo All software already removed or no client installed.

GOTO END

:DEL07
echo Found SCCM Client v2007. Removing...
%windir%\System32\ccmsetup\ccmsetup.exe /uninstall
RD /S /Q %windir%\System32\ccmsetup
RD /S /Q %windir%\System32\ccm\cache
RD /S /Q %windir%\System32\ccm
echo SCCM Client 2007 removed.
IF EXIST %windir%\ccmsetup\ccmsetup.exe GOTO DEL12
IF EXIST %windir%\SMSCFG.INI GOTO DELINI
GOTO END

:DEL12
echo Found SCCM client in 64bit. Removing.
%windir%\ccmsetup\ccmsetup.exe /uninstall
RD /S /Q %windir%\ccmsetup
RD /S /Q %windir%\SysWOW64\ccm\cache
RD /S /Q %windir%\SysWOW64\ccm
echo SCCM Client in 64bit removed.
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCMSetup" /F
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ccm" /F
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\SMS" /F

IF EXIST %windir%\SMSCFG.INI GOTO DELINI
GOTO END

:DELINI
echo SMSCFG file found. Removing...
del /F %windir%\SMSCFG.INI
echo SMSCFG file removed.
GOTO END

:END
REG DELETE "HKLM\software\Microsoft\ccm" /F
REG DELETE "HKLM\software\Microsoft\CCMSETUP" /F
REG DELETE "HKLM\software\Microsoft\SMS" /F
echo Done!
rem I always put a pause for testing. derem and you can see the text fly by.
exit




No comments:

Post a Comment

SCCM Application Deployment Tool

SCCM Application Deployment Tool Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool. In the realm o...