Skip to main content
13-Aquamarine
September 18, 2015
Solved

sys window run batch file?

  • September 18, 2015
  • 1 reply
  • 1501 views

Is there any way, when you open a system window, to tell it to run a batch file.

I'd like to create a mapkey that opens a system window which calls a batch file to examine a file and tell the user what start models were used to create it.


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.
Best answer by psobejko

I think that you can accomplish this by using the @SYSTEM keyword in your mapkey definition:

mapkey mbf @MAPKEY_LABELRun MY_BATCH_FILE (mbf);\

@SYSTEMstart c:\\MY_MAPKEYS\\MY_BATCH_FILE.bat;

MY_BATCH_FILE.bat should probably end with "exit" in order to close the window after it is done...

Pro/TIP: note how the actual string to be typed to trigger the mapkey (mbf) was included in the MAPKEY_LABEL - this makes it easy to "recall" what the mapkey is later on by using the "Command Search" box in the Creo ribbon.

In above, searching for "batch" will bring up a list which will have an entry "Run MY_BATCH_FILE (mbf)".

1 reply

psobejko1-VisitorAnswer
1-Visitor
September 18, 2015

I think that you can accomplish this by using the @SYSTEM keyword in your mapkey definition:

mapkey mbf @MAPKEY_LABELRun MY_BATCH_FILE (mbf);\

@SYSTEMstart c:\\MY_MAPKEYS\\MY_BATCH_FILE.bat;

MY_BATCH_FILE.bat should probably end with "exit" in order to close the window after it is done...

Pro/TIP: note how the actual string to be typed to trigger the mapkey (mbf) was included in the MAPKEY_LABEL - this makes it easy to "recall" what the mapkey is later on by using the "Command Search" box in the Creo ribbon.

In above, searching for "batch" will bring up a list which will have an entry "Run MY_BATCH_FILE (mbf)".