Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi everyone,
I'm working on automating a process using a batch file that will be triggered as a scheduled task. The steps I'm trying to automate are as follows:
1- Launch Creo Parametric (version 10.0.7.0)
2- Start a tool that interacts with Creo to run it automatically in the background.
3- Shut down the configurator.
4- Shut down Creo itself.
Parts 2 and 3 are not a problem: this tool was developed by our consultants using the Creo toolkit. It's simply a matter of invoking one batch file to start it and another to stop it. The issue is with the shutdown of Creo. I don't want to use a brute-force taskkill command to close Creo, as I'd prefer a more graceful and proper way to do it. I considered simulating keyboard shortcuts (such as Alt+F+X) to close the program, using either VBScript or AutoHotkey, but here's the catch: since this task will be running as a scheduled task, with no user logged in, none of these solutions will work because they require the UI to be accessible (i.e., user must be logged in).
Does anyone have suggestions or ideas for an approach that would work in this scenario, where the task is running without an active user session? Unfortunately, we do not have a license for the Creo toolkit, so solutions that rely on it are not an option for us.
Any help or guidance would be very much appreciated.
Thanks in advance!
Giacomo
Solved! Go to Solution.
Hello,
Thank you for your reply.
In the end, we asked our consultant to develop a closure for Creo using the Toolkit.
Regards,
Giacomo
Start Creo Parametric in non-graphics mode & run a trail file. The trail file can start your toolkit program using @system to launch your .bat script, shut down the configurator (again using @system), and then exit Creo Parametric.
Regards,
Dan N.
Hello Dan,
Thank you for your response!
I tried following your suggestion: I took a trail file generated by simply opening and closing Creo, and added the line
~ @system("C:\path\file.bat")
right before the shutdown command.
Then, I launched Creo in non-graphics mode using the following command:
start C:\path\parametric.exe -g:no_graphics "path_trail_file"
Creo launches and shuts down correctly, following the trail file as expected. However, the batch file seems to be completely ignored during execution - there’s no indication that it runs at all. I'm not sure if I'm missing something in the syntax or configuration, or if additional steps are required for the @system call to be processed properly.
Best wishes,
Giacomo
Hi Dan,
After discussing it, we realized that using a trail file wasn't the right approach, as we needed Creo to remain open. In the end, we asked our consultant to create a closure command using Creo Toolkit.
Thank you anyway for the time you took to reply to me.
Sincerely,
Giacomo
Hi @GiacomoS,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
I guess it is an async application which connects to Creo on Starting the app. ask the developer to add an option to end Creo if the job is done, this could be done by an environment var. So about 5 lines of code.
Stop Creo in synchronous mode
extern ProError ProEngineerEnd( void );
/*
Purpose: Terminates a Creo Parametric session. In synchronous mode,
the function also terminates any Creo Parametric TOOLKIT process
started by the current Creo Parametric session.
...
*/
Hello,
Thank you for your reply.
In the end, we asked our consultant to develop a closure for Creo using the Toolkit.
Regards,
Giacomo