
How to execute a command line command from a *.HTA
I tried to do that very thing in an HTA after reading this request, but
it failed. Every time I put the SET line into the script and run it an
empty IE window opens full screen and no Msgbox appears. The funny
thing is that commenting out the line has no effect. Removing the line
(after the HTA has been run at least once) still results in an empty IE
window, but it's not full screen. I wonder what's broken on my Win 98SE
box.
I'll post the 'hello world' test script I used in a new thread to see if
someone can find an error in the code.
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
Quote:
> filename = chr(34) & "full path to the file to register" & chr(34)
> set shell = createobject("wscript.shell")
> exitcode = shell.Run("regsvr32.exe /s " & filename, 0, True)
> Based on experimentation (regsvr32.exe exitcodes don't seem to be doc'd anywhere)...
> exitcode 0 = success
> exitcode 1 = invalid switch
> exitcode 3 = failure (test using a bad path causes a 3)
> exitcode 4 = exported function not found (e.g., DLLRegisterServer) or corrupt in-memory version
> (test registering a non-COM dll causes a 4)
> I don't what (if any scenario) will generate exitcode 2 or if there are any other failure exitcodes
> other than these (for example, Permission denied, LoadLibrary failures, missing/incompatible
> dependencies, etc.)
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> Please do not email questions - post them to the newsgroup instead.
> --
> > Hi,
> > is there a way to execute a command line command from a *.hta file?
> > I want to automatically register an ocx.
> > Manually this is done by typing
> > RegSvr32 filename.ocx
> > in the Start-->Run box
> > How can I do it automatically?
> > Also if it's manually registered, a confirmation message pops up saying that
> > all is ok - is it possible to avoid it?
> > Thanks