@ECHO OFF

reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT

"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" /unregister C:\zatca\ZatcaUBLXMLGenerator.dll
"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" /codebase C:\zatca\ZatcaUBLXMLGenerator.dll /tlb C:\zatca\ZatcaUBLXMLGenerator.tlb

if %OS%==64BIT "%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\regasm.exe" /unregister C:\zatca\ZatcaUBLXMLGenerator.dll
if %OS%==64BIT "%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\regasm.exe" /codebase C:\zatca\ZatcaUBLXMLGenerator.dll /tlb C:\zatca\ZatcaUBLXMLGenerator.tlb

pause