I'd like to update my start script for Creo thus that it checks which date code version is installed on the users computer (e.g. M040, M090...)
Is there a general parameter, which i can use to do this?
Markus
Solved! Go to Solution.
hello, we are using a DOS script:(if somebody has a better way...maybe we can do an idea ?)
we install Creo in : C:\CAO\appli\Creo 2.0
The script:
SET DRIVE=C:
SET REP_CAO=%DRIVE%\CAO
IF EXIST "%REP_CAO%\Appli\Creo 2.0" SET CREO_INSTALL=%REP_CAO%\Appli\Creo 2.0
SET PARAMETRIC_INSTALL=%CREO_INSTALL%\Parametric
SET COMMONFILES_INSTALL=%CREO_INSTALL%\Common Files
:: *** Récupération du release installé de Creo
PUSHD %COMMONFILES_INSTALL%
FOR /F %%a IN ('DIR /d /b') DO SET RELEASE=%%a
POPD
SET COMMONFILES_INSTALL=%CREO_INSTALL%\Common Files\%RELEASE%
ECHO RELEASE: %RELEASE%
ECHO COMMON FILES: %COMMONFILES_INSTALL%
Best Regards
Markus,
let us assume that you call something like C:\PTC\Creo 2.0\Parametric\bin\parametric.exe inside your script.
To get Creo Parametric 2.0 date code, look for the name of subdirectory of C:\PTC\Creo 2.0\Common Files directory.
Martin Hanak
hello, we are using a DOS script:(if somebody has a better way...maybe we can do an idea ?)
we install Creo in : C:\CAO\appli\Creo 2.0
The script:
SET DRIVE=C:
SET REP_CAO=%DRIVE%\CAO
IF EXIST "%REP_CAO%\Appli\Creo 2.0" SET CREO_INSTALL=%REP_CAO%\Appli\Creo 2.0
SET PARAMETRIC_INSTALL=%CREO_INSTALL%\Parametric
SET COMMONFILES_INSTALL=%CREO_INSTALL%\Common Files
:: *** Récupération du release installé de Creo
PUSHD %COMMONFILES_INSTALL%
FOR /F %%a IN ('DIR /d /b') DO SET RELEASE=%%a
POPD
SET COMMONFILES_INSTALL=%CREO_INSTALL%\Common Files\%RELEASE%
ECHO RELEASE: %RELEASE%
ECHO COMMON FILES: %COMMONFILES_INSTALL%
Best Regards
Thanks Fabrice,
that's exactly the answer i was looking for
Best Regards
Markus
THANK YOU! We have been trying to figure this out for a long time.
Also for those moving to Creo 3.0 here is the new version.
We install to C:\PTC
So the Creo 3.0 folder is install to the above location.
SET DRIVE=C:
SET REP_PTC=%DRIVE%\PTC
IF EXIST "%REP_PTC%\Creo 3.0" SET CREO_INSTALL=%REP_PTC%\Creo 3.0
:: *** Recover Creo install release
PUSHD %CREO_INSTALL%
FOR /F %%a IN ('DIR /d /b') DO SET RELEASE=%%a
POPD
SET CREO_INSTALL=%CREO_INSTALL%\%RELEASE%
SET PARAMETRIC_INSTALL=%CREO_INSTALL%\Parametric
SET COMMONFILES_INSTALL=%CREO_INSTALL%\Common Files
ECHO RELEASE: %RELEASE%
ECHO COMMON FILES: %COMMONFILES_INSTALL%
Thanks for the tip and examples that others provided.
I am using the command DIR /A:D /O:N /B instead to list only folders without the full path. The /D option (Wide List format, sorted by vertical column.) only controls the output format, and does not do anything since when /B option (Bare format (no heading, file sizes or summary).) is used then the wide list format is not used. To get only directories the option should be /A:D for file attributes of folders only. To sort by name the option /O:N can be used.
Example:
:: Define where Creo is installed (typically C:\Program Files\PTC\Creo 2.0)
set CreoLoadPoint=C:\Program Files\PTC\Creo 2.0
:: Define release build version
pushd "%CreoLoadPoint%\Common Files"
for /f %%a in ('DIR /A:D /O:N /B') do set CreoBuildVersion=%%a
popd
References:
Dir - list files and folders | Windows CMD | SS64.com