Hope someone can help, I want to convert this bat file to vbs. Anyone have
any input on how to do this.

@echo off
if not exist alttiff.ocx goto bad
start regsvr32 alttiff.ocx
goto end
:bad
echo Error: Cannot find alttiff.ocx.
echo Note: Do not run install.bat directly from your unzip program.
echo You must create a folder and unzip everything into it.
echo Note: The current directory is:
cd
pause
:end


Thanks
Gavin...

Re: Convert from bat to vbs by Torgeir

Torgeir
Wed Sep 08 13:48:24 CDT 2004

Gavin wrote:

> Hope someone can help, I want to convert this bat file to vbs. Anyone have
> any input on how to do this.
>
> @echo off
> if not exist alttiff.ocx goto bad
> start regsvr32 alttiff.ocx
> goto end
> :bad
> echo Error: Cannot find alttiff.ocx.
> echo Note: Do not run install.bat directly from your unzip program.
> echo You must create a folder and unzip everything into it.
> echo Note: The current directory is:
> cd
> pause
> :end
Hi

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("scripting.FileSystemObject")

If oFSO.FileExists("alttiff.ocx") Then
oShell.Run "regsvr32.exe alttiff.ocx", 1, False
Else

MsgBox "Error: Cannot find alttiff.ocx." & vbCrLf & vbCrLf _
& "Note: Do not run the script directly from your unzip program." _
& vbCrLf _
& "You must create a folder and unzip everything into it." _
& vbCrLf & vbCrLf _
& "Note: The current directory is: " & vbCrLf _
& oFSO.GetFolder(".").Path _
, vbCritical + vbSystemModal, "Registering alttiff.ocx"

End If
'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded
from here if you haven't got it already:

http://msdn.microsoft.com/downloads/list/webdev.asp



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