Программа при запуске выдаёт ошибки

GMR Error 37
или
GMR Error 37-2020 (s) - Windows Error: Недопустимый класс
или другие подобные ошибки с текстом "GMR Error 37 ..." - что делать?



The Cause of Code 80041001

It's probably no consolation that this is a poorly documented error. Again, thanks to Mark he said that it was intermittent, and the same script worked fine on another server. Makes me suspect that one source of this problem is Active Directory synchronisation. Another cause of a Code 80041001 problem is that the underlying service has stopped, for example the spooler service. (Thanks to Robin Lee for this info).

The Solutions

Try running your VBScript on another machine? If this works, then your code is probably fine, it's more of a logical problem, or something up with the OS / Active Directory. I hate it when people say 'reboot the server', so try simply restarting the services that you are investigating.

One possibility is that your winmgmts service is corrupted if so, you have the following options. To be honest, I believe that there is only a 20% chance that these procedures will cure your 80041001 problem. A bonus is that you will learn or have a refresher on restarting services and registering services in the registry.



Если коротко - причина ошибки в том, что "что-то сломалось" в операционной системе Windows.
Соответственно, нужно либо это исправить, либо переустановить Windows, либо искать какие-либо другие обходные пути.
Вариант с исправлением ошибки описан ниже:



1) Start and Stop the winmgmts service. Navigate to the command prompt.

Наберите

net stop winmgmt

в командной строке, запущенной под Администратором



2) Using Windows Explorer, navigate to %systemroot%\system32\wbem directory and delete the Repository directory. By default, the repository folder is located in the C:\Windows\system32\wbem directory.

Нужно удалить/переименовать только подкаталог (поддиректорию)

C:\Windows\system32\wbem\Repository

!!! весь каталог/директорию C:\Windows\system32\wbem удалять/переименовывать НЕ НУЖНО !!!



3) Switch to Command Prompt window, and type: net start winmgmt

Переключитесь обратно в командную строку (запущенную на шаге 1 от имени Администратора), наберите

net start winmgmt



4) Re-Register the DLLs
The .DLL and .EXE files which WMI uses are located in %windir%\system32\wbem. This is how you re-register all the .DLL and .EXE files in the WBEM directory. To re-register the WMI components, run the following commands at the command prompt:


В командной строке (запущенной от имени Администратора) наберите

cd /d %windir%\system32\wbem
for %i in (*.dll) do RegSvr32 -s %i
for %i in (*.exe) do %i /RegServer