Sponsored by: technoDAVE
(Answer) (Category) Pro/ENGINEER FAQ - 2005 : (Category) Installation and Configuration : (Category) Batch Files and Scripts :
Does anyone have a decent startup batch file?
This batch file is used with a shortcut that has three parts to the command line:

First, a version specifier for the $LOADPOINT variable
Second, a directory path for the $PROJECT variable
Third, a directory path for the $CONFIG variable

Note:
  1. Replace D:\Programs\PTC as needed
  2. Directories are the same as the Pro/E start command, e.g. pro2000i

@echo off

rem %1 is version number, same as bin command, e.g. pro22

rem It's not necessary to have Pro/E on path
rem
PATH D:\Programs\PTC\%1\bin;%path%

set LOADPOINT=d:\Programs\PTC\%1\bin

rem CONTINUE_FROM_OOS=1 suggested to eliminate trail file crashes
rem
set CONTINUE_FROM_OOS=1

rem $HOME used in config.pro, not necessary if system set
rem
set HOME=%HOMEDRIVE%%HOMEPATH%

rem startup script will change to $PROJECT working directory
rem
set PROJECT=%2

rem $CONFIG is actually startup directory for config.pro
rem
set CONFIG=%3

call d:\batch\cleantrail.bat (Download) CleanTrail.bat.txt (164 bytes)


rem startup.txt is trail file to change working directory and open file dialogue box
rem
call %LOADPOINT%\%1 %CONFIG%\startup.txt

startup.txt
-----------
!trail file version No. 1029
!Pro/ENGINEER  TM  Release 20.0  (c) 1988-98 by Parametric Technology Corporation  All Rights Reserved.
~ Activate `main_dlg_cur` `main_dlg_cur`
~ Select `main_dlg_cur` `MenuBar1` \
1  `File`
~ Close `main_dlg_cur` `MenuBar1`
~ Activate `main_dlg_cur` `File.wd`
~ Select `main_dlg_cur` `MenuBar1` \
1  `File`
~ Close `main_dlg_cur` `MenuBar1`
~ Activate `main_dlg_cur` `File.psh_working_dir`
~ Update `file_open` `Inputname` \
 `$PROJECT`
~ Activate `file_open` `Open`
~ Activate `main_dlg_cur` `ProCmdModelOpen.file`

Updated September 28, 2001

For those of you with multiple licenses, a simple interrogation to give users a chance to pick from different configurations:


rem
rem choice.exe sets ERRORLEVEL 1 for first option (Y), 2 for second (N)
rem choice.exe has a default timeout option
rem
cls
ECHO.
ECHO.
ECHO Do you want the Advanced Surface (ASX) license? [Yes or No]
ECHO.
ECHO.
ECHO    -- Anything but "Y" or "y" will bring up next question            
ECHO.
ECHO    No response needed to accept current option
choice.exe /N /TY,5
ECHO.
ECHO.

IF ERRORLEVEL 2 goto foundation
call %PRO_DIRECTORY%\bin\proe2001.bat start2001.txt
goto end

Choice.exe is from the Windows NT Resource Kit. This is not a complete script, but it shows how to use the error level code generated by the choice utility to move through several license options.

[Append to This Answer]
This document is: http://www.proefaq.com/cgi-sys/cgiwrap/proegeek/fom.cgi?file=42
[Search] [Appearance]
 
Privacy Statement