Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Batch file that plays same trail file on multiple parts

Batch file that plays same trail file on multiple parts

Batch file that plays same trail file on multiple parts

I registered here to ask this question. I've been working on it off and on for a week and can't quite figure out where I'm going wrong.

I'm going to have about 100 parts coming through that I need to populate parameters for (and a couple other tasks).
So I recorded a trail file that will do the tasks. I tested it independently and it works no problem.

I then wrote a batch file that will go through the directory I give it (where the parts are located), it will export the list of parts to a text file.
Using this list, I set up a FOR loop to replace the part number in the trail file at each iteration.

The problem I'm running into is this:
When the batch file directs Creo to open a file, I get this message:


Cannot find C:\Users\uh345d\Desktop\AutoCreo\Backup\PA.txa C:\Users\uh345d\Desktop\AutoCreo\Backup\Test_Folder\%%a

Basically, Creo is trying to open that as a single file, instead of opening %%a (Part from list) and running PA.txa (Trail File)
I tried inserting pro_wait as well, as it was a separate command I ran across that may or may not help :p

Here is my code:


ECHO Brought to you by: ME
:: Prompts user for the directory
set /p pathName=Enter the File Path of the folder:
set /p username=Enter your username:

:: 1. Change to the location set above
:: 2. List all files in that directory and store in a text file on desktop
cd %pathName%
dir /s /b *.* > c:\users\%username%\desktop\list.txt

:: 3. Opens Creo then runs 'for loop' to run script against each file in list.txt
:: This sets and populate parameters
:: 4. Add -g:no_graphics to run in non windows mode
for /f "delims=" %%a in (c:\users\%username%\desktop\list.txt) do ("c:\Program Files\PTC\Creo 2.0\Parametric\bin\parametric.bat" pro_wait "C:\Users\%username%\Desktop\PA.txa %%a")


Any help would really be appreciated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close