Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

running /REGSERVER from a script

994 views
Skip to first unread message

David Cahill

unread,
Dec 21, 2000, 4:38:56 AM12/21/00
to
Hi,
is it possible to register an exe using a script?
I need to use /regserver and not regsvr32.exe.

thanks,
David


Michael Harris

unread,
Dec 21, 2000, 1:35:30 PM12/21/00
to
set WshShell = CreateObject("wscript.shell")
rc = WshShell.Run("""drive:\full path spec\myserver.exe"" /regserver",1,True)

--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--

"David Cahill" <da...@trados.ie> wrote in message news:#TOJZHzaAHA.1960@tkmsftngp04...

John Stocksdale

unread,
Dec 21, 2000, 6:21:00 PM12/21/00
to
I was just working with a similar problem -

I frequently want to register/unregister dlls on the production web server after having
tested the component on the staging machines. I've taken to using a couple of tiny *.bat
files for both registering and unregistering - then placed a shortcut to each *.bat file
in my "Send to" folder so that I can register/unregister the dll's from Windows Explorer
with a right click and selecting the appropriate bat file which is then passed the file
name.

I've been unable to do this with a *.vbs file for some reason (the bat files seem to force
me to use 8.3 file names as they want to shorten the long file names). The vbs file runs
fine from the command line or from a desktop shortcut (including receiving any command
line arguments) but not off the "send to" folder (it just sits there?).

What gives?

John S.

Michael Harris

unread,
Dec 21, 2000, 7:46:51 PM12/21/00
to
This works for me (it's just a demo - it really should have more sanity
checking ;-)...

I created a shortcut to this script and put it in my SendTo folder.

'===RegServer.vbs===

set args = wscript.arguments
if args.count <> 1 then
msgbox "send one file at a time"
wscript.quit
end if
fname = args(0)
msgbox fname
fname = chr(34) & fname & chr(34)
set shell = createobject("wscript.shell")
rc = shell.run(fname & " /regserver",1,true)
msgbox rc


--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--

"John Stocksdale" <jsto...@sound.net> wrote in message
news:3A42905B...@sound.net...

John Stocksdale

unread,
Dec 22, 2000, 10:45:37 AM12/22/00
to
There must have been some file association problem on this machine as changing
the default action on the wsf file type to "Open with Command Prompt" allowed
the file to run from the right click - changing the setting back to default
simply to "Open" it still works (???- but I'll take it)

BTW: line 10 of the sample seems to be reversed:
rc = shell.run("/regsvr32 " & fname, 1, true) ' this worked ok

Thanks a million:

0 new messages