cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

Batch File

JoseVidal
1-Newbie

Batch File

Hello all! I have a batch file to start ProE. It does a few cleaning operations, copies the config.pro and config.win files to a specified dir and it launches ProE. Now I want it to do the following: 1. I first pointed my batch file to <load_point>/bin/proe.exe to lauch ProE, however the working dir was not the one I wanted. Workaround: made the batch file point to a shortcut and, in that shortcut, defined the working dir I wanted in its properties. Don't know if there's an easy/cleaner way to do this? 2. I want to have 2 icons on my desktop: one launches WF and another launches WF+EMX. But I wanted to have only 1 config.pro. Since I need to add the protkdat config option I want my batch file to do the following: a. copy config.pro to working dir b. edit config.pro c. add the protkdat config option d. save and close config.pro e. launch WF+EMX Any help would be much appreciated! Best regards! JVidal
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
9 REPLIES 9

Update: Nevermind point #1. The shortcut for the batch file that launches ProE that I placed on my desktop, also has a "Start In" field. I filled it with my working directory and it worked. Still stuck on point #2, though! Best regards! JVidal

Use the piping command in your start.bat to add the PROTKDAT path to your config.pro. echo PROTKDAT C:\Your_Path_To\protk.dat >> C:\Your_Path_To\config.pro

Or use a extra config.pro only when starting with EMX Config.pro can be ´located in 3 locations: 1. proewildfire4/text/ 2. Users home directory ex: C:\Documents and Settings\username 3. working directory You can then in your start script copy the special config.pro to users home directory if they have selected to start with EMX. But start the script to always delete config.pro from users home directory. This way you make sure that it is removed before a users start a normal ProE BTW. Another tip is: Is you place a file calles ptc_startup.bat in folder ..\proewildfire4\ ProE will always run this script You can use same start script for ProE with and without EMX. You just have to set different options (%1) in the shortcut to start the scripts. In you script: del /q "%homedrive%%homepath%\config.pro" del /q "%homedrive%%homepath%\config.wi*" if "%1" == "emx" copy ...\configemx.pro "%homedrive%%homepath%\config.pro" ...

"Shane Brenner" wrote:

Use the piping command in your start.bat to add the PROTKDAT path to your config.pro. echo PROTKDAT C:\Your_Path_To\protk.dat >> C:\Your_Path_To\config.pro

Proe will merge config.pro from the 3 locations. So you only have to add what is special needed to the extra config.pro Regarding batch script. Try to search in Google: http://www.google.com/search?q=batch+%251&rls=com.microsoft:da&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1

Thank Johannes. Already knew about the config.pro locations, but still I prefer to have only one config.pro and propagate all my changes through the use of batch files. This is my setup (for now): - one config.pro with all my settings (located at D:\ProENGINEER_Configs) - 2 batch files (one to launch WF5, another to launch WF5+EMX) - 2 shorcuts for these batch files on my desktop My batch files look like this: @echo off cls del D:\ProENGINEER\config.pro (this is my working dir) del D:\ProENGINEER\config.win del D:\ProENGINEER\*.log.* del D:\ProENGINEER\std.err.* del D:\ProENGINEER\std.out.* del D:\ProENGINEER\trail.* del D:\ProENGINEER\Trail\trail.* copy D:\ProENGINEER_Configs\config_wf5.pro D:\ProENGINEER\config.pro copy D:\ProENGINEER_Configs\config.win D:\ProENGINNER\config.win -- To launch EMX on my 2nd batch file, I added here the line you suggested echo protkdat C:\Software\PTC\EMX\text\protk_wf4.dat >> D:\ProENGINEER\config.pro -- C:\Software\PTC\ProENGINEER_WF5\bin\proe.exe --------------------------- As you can see, my batch files are quite simple! Any suggestions are welcome! Best regards! JVidal

Try this in a start script we could call wf_start.bat @echo off cls del D:\ProENGINEER\config.pro (this is my working dir) del D:\ProENGINEER\config.win del D:\ProENGINEER\*.log.* del D:\ProENGINEER\std.err.* del D:\ProENGINEER\std.out.* del D:\ProENGINEER\trail.* del D:\ProENGINEER\Trail\trail.* copy D:\ProENGINEER_Configs\config_wf5.pro D:\ProENGINEER\config.pro copy D:\ProENGINEER_Configs\config.win D:\ProENGINNER\config.win if "%1" == "emx" echo protkdat C:\Software\PTC\EMX\text\protk_wf4.dat >> D:\ProENGINEER\config.pro C:\Software\PTC\ProENGINEER_WF5\bin\proe.exe Start command in shortcut to start script wf_start.bat: 1. With emx: ...\wf_start.bat emx 2. Without emx ...\wf_start.bat

Johannes, This worked very well. And it's a much simpler. I now have only one batch file and one config.pro, and still I can lauch 2 diferent setups using 2 icons on my desktop! As far as I understand %1 is a variable, right? So you setup a condition saying that if %1 is equal to string emx, it would add protk to config.pro. The only thing that I couldn't quite grasp is how did that varible was filled adding its value on the shortcut? I thought these variables were supposed to be filled through the commands on the batch file. Anyway, thank you for your help. I'm quite pleased with the results. Best regards! JVidal

Yes %1 is a variable. It is "fill" in the shortcut. command a b c d e Then %1=a %2=b %3=c %4=d %5=e ...