Login | |
|
 |
RE: Register a OCX file with a vbscript. - 11/23/2005 6:26:31 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
This shouldn't be too difficult with vbscript. First you'll need to write in the code to search for the file itself. There have been several posts out here for locating files, so I would suggest you search for that first; once you've located the code for locating your file you can then use this bit to register the file: Set oShell = CreateObject("Wscript.Shell") oShell.Run "RegSvr32 /s " & chr(34) & "Path\to\file.ocx" & chr(34) RegSvr32 switches /u = Unregister server /s = Silent; display no message boxes /i = Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall /n = do not call DllRegisterServer; this option must be used with /i chr(34) Used to add extra set of quotes " around a string. Used when passing to a cmdline or when there are spacing in the path you are using.
|
|
| |
|
|
|
 |
RE: Register a OCX file with a vbscript. - 11/23/2005 8:52:30 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
If you know th file is there then you do not need to do the locate file part. Just do as Country 73 suggested and use the path and name of the ocx that you copied over.
|
|
| |
|
|
|
 |
RE: Register a OCX file with a vbscript. Follow Up How-... - 9/18/2006 11:54:40 PM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Not a quick and simple way that I know of. What you can do is use something like Regmon or Advanced Registry Trace to determine what registry changes happen when the file is registered then check the machines for those registry indicators.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Register a OCX file with a vbscript. Follow Up How-... - 8/10/2007 5:32:45 AM
|
|
 |
|
| |
CondoPC
Posts: 118
Score: 0
Joined: 7/23/2007
Status: offline
|
As for whether it is registered or not, couldn't you just try to activate the component? If you can, it registered, otherwise it didn't. Also, we have a "Send To" shortcut for "unregister" (regsvr32 -u) and register (regsvr32) so that a user can right click on a file and send it to the shortcut. This seems to be focused around a support function for the application. Wouldn't it make sense to write a support application that could be accessed from the help menu that would verify file registration (activate a component) and register it if missing? Or even in the worse case, just reregister the component anyways. Something like "Repair application files". If it is a helpdesk doing support for users not withtin the organization, would sending them a vbscript file be an acceptable solution? I know that in my company, that would be a definite no-go.
|
|
| |
|
|
|
|
|