Using vbs in my msi setup program,
the following command does not work on client but I can't figure out
what's the problem as the command windows closes itself immediately
after displaying the error message.

CreateObject("Wscript.Shell").Run
"C:\Windows\Microsoft.Net\Framework\v1.1.4322\regasm /tlb """ &
Property("Installpath") & "UBPTREX.dll"""

Does somedy know how I could log the error (nothing in event log) or
prevent the cmd windows to close after running command ?

Thks for help

Re: How can I log my vbscript command by jeff

jeff
Mon Feb 21 11:14:36 CST 2005

On 21 Feb 2005 07:19:51 -0800, "Franck" <wesley.saris@gmail.com>
wrote:

>Using vbs in my msi setup program,
>the following command does not work on client but I can't figure out
>what's the problem as the command windows closes itself immediately
>after displaying the error message.
>
>CreateObject("Wscript.Shell").Run
>"C:\Windows\Microsoft.Net\Framework\v1.1.4322\regasm /tlb """ &
>Property("Installpath") & "UBPTREX.dll"""
>
>Does somedy know how I could log the error (nothing in event log) or
>prevent the cmd windows to close after running command ?

Run the command manually in a command prompt window on the client and
see what happens.

Jeff

Re: How can I log my vbscript command by Torgeir

Torgeir
Mon Feb 21 12:04:26 CST 2005

Franck wrote:

> Using vbs in my msi setup program,
> the following command does not work on client but I can't figure out
> what's the problem as the command windows closes itself immediately
> after displaying the error message.
>
> CreateObject("Wscript.Shell").Run
> "C:\Windows\Microsoft.Net\Framework\v1.1.4322\regasm /tlb """ &
> Property("Installpath") & "UBPTREX.dll"""
>
> Does somedy know how I could log the error (nothing in event log) or
> prevent the cmd windows to close after running command ?
Hi

Try this (using %comspec% /k):

CreateObject("Wscript.Shell").Run _
"%comspec% /k %windir%\Microsoft.Net\Framework\v1.1.4322\regasm /tlb """ _
& Property("Installpath") & "UBPTREX.dll""", 1, True


Does Property("Installpath") always deliver a path with a terminating
backslash? If not, use \UBPTREX.dll instead pf UBPTREX.dll


I have also changed C:\Windows to %windir% to avoid hard coding of the
Windows path.


--
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

Re: How can I log my vbscript command by gpc0746

gpc0746
Thu Mar 03 03:13:43 CST 2005


Create an error handler.

at the top of your code type
On Error goto Err_Handler


at the bottom of your code type

Exit or Exit sub it if is a sub
Err_Handler:
msgbox "The following error occurred: " & err.description




That is the simplest way to create a message box on error. A log can be
kept. Here is some code I've used. Just place this instead of the msgbox
command.

LogLocation = THE PATH OF THE LOG

set objFS05= CreateObject("Scripting.FileSystemObject:)

set objtextfile2= objFS05.OpenTextFile (LogLocation, ForAppending,
True)

ObjTextFile2.Writeline("An error has occurred: " & err.description)



--
gpc0746
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------


Re: How can I log my vbscript command by Michael

Michael
Thu Mar 03 22:23:57 CST 2005

gpc0746 wrote:
> Create an error handler.
>
> at the top of your code type
> On Error goto Err_Handler
>

Check the VBScript docs...

VBScript supports only

On Error Resume Next
On Error GoTo 0

and it does not support GoTo (as a separate statement) or statement
labels...


>
> at the bottom of your code type
>
> Exit or Exit sub it if is a sub
> Err_Handler:
> msgbox "The following error occurred: " & err.description
>

--
Michael Harris
Microsoft MVP Scripting
http://maps.google.com/maps?q=Sammamish%20WA%20US