0

I want to be able to run a batch file automatically when I exit Catia. So when I select the file exit menu option the batch file will run. Similarly when I click the Catia close X button top right. The batch file will also run. Is there a specific sub function that executes when exiting Catia?

The vbscript below launches the batch file.

Sub CATmain()
Dim shell
Set shell = CreateObject("wscript.shell")
shell.Run "c:\windows\temp\test.bat"
End Sub

Any help much appreciated.

David Egan
  • 424
  • 2
  • 8
  • 23

1 Answers1

0

Configuring Catia to run a batch script when it exits is up to Catia. A workaround might be to start Catia from a batch script that would run test.bat when it returns.

=== runcatia.bat

SETLOCAL
SET EXITCODE=0

catia.exe
SET EXITCODE=%ERRORLEVEL%
"c:\windows\temp\test.bat"
EXIT /B %EXITCODE%
lit
  • 14,456
  • 10
  • 65
  • 119