@echo off
Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegQry% > checkOS.txt
Find /i "x86" < CheckOS.txt > StringCheck.txt
If %ERRORLEVEL% == 0 (
echo "This is 32bit system"
reg query HKLM\Software\Microsoft\Office\10.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office XP Registration Key"
REG DELETE HKLM\Software\Microsoft\Office\10.0\Registration /f
)
reg query HKLM\Software\Microsoft\Office\11.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2003 Registration Key"
REG DELETE HKLM\Software\Microsoft\Office\11.0\Registration /f
)
reg query HKLM\Software\Microsoft\Office\12.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2007 Registration Key"
REG DELETE HKLM\Software\Microsoft\Office\12.0\Registration /f
)
reg query HKLM\Software\Microsoft\Office\14.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2010 Registration Key"
REG DELETE HKLM\Software\Microsoft\Office\14.0\Registration /f
)
) ELSE (
echo "This is 64bit system"
reg query HKLM\Software\Wow6432Node\Microsoft\Office\10.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office XP Registration Key"
REG DELETE HKLM\Software\Wow6432Node\Microsoft\Office\10.0\Registration /f
)
reg query HKLM\Software\Wow6432Node\Microsoft\Office\11.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2003 Registration Key"
REG DELETE HKLM\Software\Wow6432Node\Microsoft\Office\11.0\Registration /f
)
reg query HKLM\Software\Wow6432Node\Microsoft\Office\12.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2007 Registration Key"
REG DELETE HKLM\Software\Wow6432Node\Microsoft\Office\12.0\Registration /f
)
reg query HKLM\Software\Wow6432Node\Microsoft\Office\14.0\Registration > nul 2>&1
if not ErrorLevel 1 (
echo "Deleting Office 2010 Registration Key"
REG DELETE HKLM\Software\Microsoft\Office\14.0\Registration /f
)
)
del stringcheck.txt /Q
del checkos.txt /Q
pause