stev379
Guest
|
Posted:
Tue Jan 04, 2005 6:47 pm Post subject:
Unreg DLL with vbs list/array |
|
|
I have a list of DLL's that changes that need to be registered and
unregistered. I'd like to be able to add to this list without editing many
different or large portions of the script. My attemps have failed with many
different efforts similar to what you see below. Any help with getting this
to work either pulling the variable of the DLL names from an array within the
script or a seperate list (txt, csv) is greatly appreciated.
Thanks!
-Steve
Begin Script
Option Explicit
Dim fso, Windir, WinSys, shell, filename, sCmd
'On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Windir = fso.GetSpecialFolder(0)
Set shell = CreateObject("WScript.Shell")
Filelist = array( _
"MyDll1.dll", _
"MyDll2.dll")
For each Filename in Filelist
Shell.run (Windir & "\System32\regsvr32.exe /u" filename)
Next
msgbox "Done"
'End Script |
|
Torgeir Bakken (MVP)
Guest
|
Posted:
Thu Jan 06, 2005 11:05 pm Post subject:
Re: Unreg DLL with vbs list/array |
|
|
stev379 wrote:
| Quote: | I have a list of DLL's that changes that need to be registered and
unregistered. I'd like to be able to add to this list without editing many
different or large portions of the script. My attemps have failed with many
different efforts similar to what you see below. Any help with getting this
to work either pulling the variable of the DLL names from an array within the
script or a seperate list (txt, csv) is greatly appreciated.
Thanks!
-Steve
Begin Script
Option Explicit
Dim fso, Windir, WinSys, shell, filename, sCmd
'On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Windir = fso.GetSpecialFolder(0)
Set shell = CreateObject("WScript.Shell")
Filelist = array( _
"MyDll1.dll", _
"MyDll2.dll")
For each Filename in Filelist
Shell.run (Windir & "\System32\regsvr32.exe /u" filename)
Next
Hi |
Use
Shell.run Windir & "\System32\regsvr32.exe /u " & filename, 1, True
Added a space behind /u, and added a needed & before "filename", and
also configured the Run method to wait for regsvr32.exe to finish
before continuing with the next loop.
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx |
|