Richard
Tue Mar 04 11:23:27 CST 2008
systemtek wrote:
> Hi All, I know how to register a .dll on my own PC as followes :
>
> Dim objShell
> Set objShell = CreateObject("WScript.Shell")
> objShell.Run "regsvr32.exe c:\windows\system32\whatever.dll"
>
> But how do i register a .dll on another PC, i mean i want to run the
> script on my PC so it will connect to the listed PC/PC's and register
> a dll on them ?
This can be done, but involves several steps.
1. Use WMI to connect to the remote computers. It is best to first ping the
machines to avoid the long timeout if any are not available.
2. Copy an executable to the remote computer. This can be a batch file or
VBScript similar to your example. It must run silently with no user
intervention, since there will be no user.
3. Run the executable on the remote computer.
4. Wait for the executable to complete and then delete it.
I have an example VBScript program that does this for all computer objects
in a group linked here:
http://www.rlmueller.net/Deploy.htm
I use an Active Directory group because this is easy to manage. The script
keeps a detailed log. It doesn't matter if anyone is logged on to the
computers or not, but they must be powered on and authenticated to the
domain.
I would suggest you use a command similar to:
strCmd = "%comspec% /c regsvr32 /s ""%SystemRoot%\system32\whatever.dll"""
objShell.Run(strCmd, 2, True)
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net
--