Batch file throwing error - .bat(Batch)Calling from C#


If i run the PowerShell script from a .bat file mannually it is working fine.

Same Script calling from .Bat file in c#, getting below error:

"Exception: Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

Please help me.

asked on Stack Overflow Apr 2, 2020 by Jethij

1 Answer


The COM component can be uninstalled,unregistered or corrupted. Install/Repair it or register it using Regsvr32.

If reinstalling it repairing the component doesn't work then verify all of your assemblies are compiled in correct architecture. You may be running the project in x64 environment but executed in x86 environment or vice versa (As @npocmaka pointed). Try changing the architecture to x86/x64.

If you are running it as x64 web app in IIS then verify app pool is not set to allow x86 applications.

answered on Stack Overflow Apr 2, 2020 by programmer365

User contributions licensed under CC BY-SA 3.0