home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 October A
/
Pcwk10a98.iso
/
Corel
/
Ventura8
/
Ventura
/
Scripts
/
DBPScheduler.csc
< prev
next >
Wrap
Text File
|
1998-07-08
|
2KB
|
75 lines
REM Launches DBPScheduler.exe [CorelSCRIPT 8]
REM DBPScheduler.csc February, 1998
REM ⌐ 1998 Corel Corporation. All rights reserved.
#addfol "..\..\Scripts"
#include "ScpConst.csi"
#include "VPConst.csi"
'/////FUNCTION & SUBROUTINE DECLARATIONS/////////////////////////////////////////////////
DECLARE SUB RegQuery()
'/////GLOBAL VARIABLES & CONSTANTS////////////////////////////////////////////////////////
GLOBAL VenturaRoot$ 'Ventura root installation directory from registry
' **************************************************************************************
' MAIN
' **************************************************************************************
ON ERROR GOTO ErrorHandler
RegQuery 'get root directory where Ventura is installed
ExecutableFile$ = VenturaRoot$ & "\Ventura\Scripts\DBPScheduler.exe"
Start:
ProcessStatus& = STARTPROCESS(ExecutableFile$)
IF ProcessStatus& = 0 THEN
Msg$ = "Unable to locate " & ExecutableFile$ & CHR(13) & "Would you like to look for the file yourself?"
MsgStatus& = MESSAGEBOX(Msg$, "Missing Executable", MB_OK_CANCEL OR MB_QUESTION_ICON)
IF MsgStatus& = MSG_OK THEN
ExecutableFile$ = GETFILEBOX( "", , , ExecutableFile$)
IF ExecutableFile$ <> "" THEN GOTO Start
ENDIF
ENDIF
ExitScript:
STOP
ErrorHandler:
SELECT CASE ErrNum
CASE 800
MESSAGE "FATAL ERROR" & CHR(13) & "Script will now exit."
RESUME AT ExitScript
CASE ELSE
MESSAGE "ERROR: " & STR(ErrNum) & CHR(13) & "Script will now exit."
RESUME AT ExitScript
END SELECT
' **************************************************************************************
' RegQuery
' This subroutine queries the Registry to determine the root directory where Ventura is installed
' **************************************************************************************
SUB RegQuery
ON ERROR GOTO ErrorHandler
VentDir$ = REGISTRYQUERY(HKEY_LOCAL_MACHINE,VENTURA_REGQUERY_CONST,"ConfigDir") 'Root directory where Ventura is installed
first% = 1
pos% = 1
DO WHILE first <> 0
first = INSTR(VentDir$, "\", first )
IF first <> 0 THEN
pos = first
first = first + 1
END IF
LOOP
VenturaRoot$ = LEFT(VentDir$, pos - 1) 'Root directory where Visual CADD is installed
EXIT SUB
ErrorHandler:
MESSAGE "Error reading registry."
ErrNum = 800
END SUB