Register a DLL file via vbScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know if the above is possible? I want to register a custom DLL
file using a vbScript and (ideally) WMI.

Can anyone help?

While I'm here, is it possible to elevate user priviledges to do the above?
The script runs under user credentials, but in XP they don't have the
necessary access to the registry to perform the changes made by registering a
DLL.

Any thoughts/help is much appreciated.
 
Mat said:
Does anyone know if the above is possible? I want to register a custom DLL
file using a vbScript and (ideally) WMI.

Can anyone help?

Set oShell = CreateObject("WScript.Shell")
oShell.Run "regsvr32.exe /s ""C:\Program Files\myDir\mydll.dll""", 1, True

While I'm here, is it possible to elevate user priviledges to do the above?
The script runs under user credentials, but in XP they don't have the
necessary access to the registry to perform the changes made by registering a
DLL.

Any thoughts/help is much appreciated.

You might get something to work using a Runas wrapper utility or
similar, take a look here:

http://groups.google.com/[email protected]

Another one that is not mentioned above:

LSrunas/LSrunasE (the latter with password encryption)
http://www.linkselection.com/lsrunas.asp


If this is an Active Directory domain, here is a better solution:

You can do it in a computer startup script that runs as part of
the boot up process (before the user logs in). It runs under the system
context and has admin rights.
 
Thanks for the quick response Torgeir.

If this is an Active Directory domain, here is a better solution:

You can do it in a computer startup script that runs as part of
the boot up process (before the user logs in). It runs under the system
context and has admin rights.

It is an active directory domain, and I've tried the above already.
Unfortunately, this also needs doing on servers (user log onto them, not my
idea honest!!) and as they are hardly ever rebooted the above won't work.
 
Back
Top