I found on Internet, this ps script may work. But the result I get is: no error pops up, but also DLL not found in registry after running the script.
Invoke-Command -ComputerName $servername -ScriptBlock {regsvr32.exe "\\uncpath\some.dll" }
I tried in both "run as administrator" and normal PS console window, and windows remote management service is on on remote server.
Any idea?
You need to use the silent option of regsrv32 (/s):
Syntax REGSVR32 [/U] [/S] [/N] /I:[CommandLine] DLL_Name
Key /u Unregister Server.
/s Silent, do not display dialogue boxes.
/i Call DllInstall to register the DLL. (when used with /u, it calls dll uninstall.)
/n Do not call DllRegisterServer, you must use this option with /i.
CommandLine An optional command line for DllInstall
/c Console output (old versions only).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With