Unreg DLL with vbs list/array
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Unreg DLL with vbs list/array

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
stev379
Guest





Posted: Tue Jan 04, 2005 6:47 pm    Post subject: Unreg DLL with vbs list/array Reply with 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

msgbox "Done"
'End Script
Back to top
Torgeir Bakken (MVP)
Guest





Posted: Thu Jan 06, 2005 11:05 pm    Post subject: Re: Unreg DLL with vbs list/array Reply with quote

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
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB