Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Creo 3, M040
In our launch batch files, I have a line that extracts the installed build code by looking in the Creo 2 installation folder:
for /f "delims=" %%A in ('dir /a:d /b "C:\Program Files\PTC\Creo 2.0\Common Files\"') do set BUILD=%%A
This reliably extracts the installed build so I can set a path to parametric.exe.
In Creo 3, this doesn't work as the build folder has been moved out of Common Files and into the main Creo 3 folder along with "Help" and "View Express". Using this line:
for /f "delims=" %%A in ('dir /a:d /b "C:\Program Files\PTC\Creo 3.0\"') do set BUILD=%%A
Sets BUILD to "View Express" instead of "M040" as I'd like.
How can I get my BUILD variable set properly in Creo 3?
Solved! Go to Solution.
Should have dug further first. Olaf Corten had the answer here:
Creo 3.0 install and build code identification
I need to add F* and M* to filter out all but the build paths, like this:
for /f "delims=" %%A in ('dir /a:d /b /o:n"C:\Program Files\PTC\Creo 3.0\F*" "C:\Program Files\PTC\Creo 3.0\M*"') do set BUILD=%%A
He also added the /o:n switch to force alphabetic order.
Until PTC adds new folders that start with F or M, this should work.
Should have dug further first. Olaf Corten had the answer here:
Creo 3.0 install and build code identification
I need to add F* and M* to filter out all but the build paths, like this:
for /f "delims=" %%A in ('dir /a:d /b /o:n"C:\Program Files\PTC\Creo 3.0\F*" "C:\Program Files\PTC\Creo 3.0\M*"') do set BUILD=%%A
He also added the /o:n switch to force alphabetic order.
Until PTC adds new folders that start with F or M, this should work.