We use Creo Parametric with Windchill PDMLink. Creo is set to "start in" a folder named "Config". This is where my config.pro, appearance files, lighting files, etc. are kept. I like to keep that folder free of clutter.
Is there a way to automatically have my Working Directory set to another location when I start the program? If I leave it set to Config & start working in a linked session with WC, all sorts of log files, BOM files, etc. get written to my Config folder. To avoid this I've made a practice of changing my Working Directory whenever I start Creo. Surely there must be a way around this?
Thanks for any help.
Solved! Go to Solution.
Perhaps there is simpler method but I know of two ways to accomplish this; by having creo run a set of commands upon startup or before Creo startup via a batch file. If it's the former, by the time Creo has loaded and sets the working directory, it may have already created some clutter files based on errors it finds in the config file, etc. Hence the reason I say below to create a "backup" location for your config files. Here are the two methods:
Personally, I use Method 2 and it works great.
Method 1 is straight forward - have your startup icon point to a batch file that runs what commands you want and then starts Creo. A method 1 batch file might look something like this (or you could just modify your parametric.bat to the following):
delete "your dumping ground folder path here"
copy "your backup path here" "your dumping ground path here"
start "" "YourPathOrEnvironmentVariableHereTo\Parametric\bin\parametric.exe" "YourPathOrEnvironmentVariableHereTo\Parametric\bin\parametric.psf" %*
Finally, change the target of your Creo icon to this batch file. Double check your parametric.bat doesn't already have any other commands that you might need to add.
For method 2, first you need to start a normal session of Creo by doing things you typically do at startup i.e. loading a config file, changing working directory, closing the browser, minimizing the UI toolbar, etc etc...anything you want automated. Then copy your trail file of the session you just started to a safe location and rename it Creo-startup.txt or something you prefer.
Now create a batch file called Creo-Startup.bat and enter the following lines:
start "" "YourPathOrEnvironmentVariableHereTo\Parametric\bin\parametric.bat" YourPathTo\Creo-Startup.txt %*
Finally, change the target of your Creo icon to this batch file. This assumes you have a parametric.bat that runs your parametric.exe file. If not, you can create one similar to method 1 above but without the delete and copy lines.
Upon startup it will run everything in the trail file you created, almost like a giant mapkey. We use it to load multiple configs and to close a few standard dialog boxes, etc. Hopefully that makes sense; post again if you get stuck.
Batch files are limited in how many parameters they can pass as an argument. %* allows all parameters to be output. I've never tried omitting the %* but I suspect you won't get much of the trail file processed.
I coming back on this old conversation as i'm using method 2 since a long time (proe5)
and it was working well .. I did follow the method on creo 2 and 3
see my start.bat file :
del "C:\install_PTC\CREO3\Creo 3.0\m060\Common Files\text\config.pro"
del "C:\install_PTC\CREO3\Creo 3.0\m060\Common Files\text\*.ui"
copy "D:\02_PROE_CONFIG\Config_creo3\00_start_file\config.pro" "C:\install_PTC\CREO3\Creo 3.0\m060\Common Files\text"
copy "D:\02_PROE_CONFIG\Config_creo3\00_start_file\*.ui" "C:\install_PTC\CREO3\Creo 3.0\m060\Common Files\text"
start C:"\install_PTC\CREO3\Creo 3.0\m060\Parametric\bin\parametric.exe" set_up_file_affaire_EC15042.txt
But now since I upgrade on creo 3 M050, i meet the following problem :
the start up file is running correctly, the config.pro seems to be applied as all colours and so on are correct,
but the mapkey are not running anymore ..!
i did the test without the "set_up_file_affaire_EC15042.txt" and everything is fine .!
what is done in the .txt file is setting the working directory and open the main asm.
by the way, i apply a sarch path file called "config.pro" placed in the start directory set in the start icon.
I don't understand what's happening ??? if anyone as an idea
thanks in advance
I guess, set_up_file_affaire_EC15042.txt is trail file. Did you try to play it from Creo session manually ? What happened in such case ?
It looks like you have a solution that you like, but I thought I'd add some more info for your consideration.
Creo looks for config files in 3 places at start up:
The last one, where your configs reside, is also set as the initial working directory. You could set that as your preferred initial working directory and put your configs in one of the other two places. The text folder gets overwritten when Creo is upgraded, so be careful storing them there. It's better to use a batch file to copy them there from another location.
If its just the working directory you are wanting switched. If you use a shortcut icon, go to the properties of the shortcut, and in the "Start in:" text box designate the location you want your working directory to be.