How to: Resolve the 'Invalid Class' or 'MAC validation' error when starting or installing
Not version-specific
Stabicad
Context: WMI Repository corruption When you start StabiBASE and the error message 'Invalid Class' appears, or you receive the "MAC validation" error during an installation, it is highly likely that the WMI (Windows Management Instrumentation) repository of your Windows operating system has become corrupted. Errors from other programs (such as Studio Management) in the Windows Event Logs also point in this direction.
Phase A: Checking the WMI repository
- In Windows, open the Command Prompt or the Run window (Start > type 'cmd' or 'Run').
- Type the following command and press Enter:
WMIMGMT.MSC - The WMI Control window opens. Right-click on WMI Control (Local) and select Properties. [Image: The WMI Control window showing the right-click menu and Properties selected]
- If retrieving these properties fails and returns an error, the repository is definitely corrupted. In that case, proceed to Phase B in consultation with your IT administrator.
Phase B: Restoring the repository (For IT Administrators)
- Open Notepad and create a new file. Ensure the encoding is set to UTF-8.
- Copy and paste the following lines exactly into the file:
@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
- Save this file as WMIrestore.bat (when saving, choose 'All files' as the type, not '.txt').
- Using Windows Explorer, place this
.batfile in the following directory:C:\Windows\System32\Wbem - Open the Command Prompt (cmd) as Administrator.
- Navigate to the correct folder by typing the following and pressing Enter:
CD C:\Windows\System32\Wbem - Now execute the
.batfile by typing its filename (WMIrestore.bat) and pressing Enter. The script will now re-register and rebuild the WMI components. - Completely reboot the computer once the script has finished. After the restart, StabiBASE should function correctly again.