Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 在退出Catia时自动运行VBScript宏_Shell_Batch File_Vbscript_Catia - Fatal编程技术网

Shell 在退出Catia时自动运行VBScript宏

Shell 在退出Catia时自动运行VBScript宏,shell,batch-file,vbscript,catia,Shell,Batch File,Vbscript,Catia,我希望能够在退出Catia时自动运行批处理文件。因此,当我选择文件退出菜单选项时,批处理文件将运行。类似地,单击右上角的Catia close X按钮时。批处理文件也将运行。是否存在退出Catia时执行的特定子功能 下面的vbscript将启动批处理文件 Sub CATmain() Dim shell Set shell = CreateObject("wscript.shell") shell.Run "c:\windows\temp\test.bat" End Sub 非常感谢您的帮助 将

我希望能够在退出Catia时自动运行批处理文件。因此,当我选择文件退出菜单选项时,批处理文件将运行。类似地,单击右上角的Catia close X按钮时。批处理文件也将运行。是否存在退出Catia时执行的特定子功能

下面的vbscript将启动批处理文件

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

非常感谢您的帮助

将Catia配置为在其退出时运行批处理脚本取决于Catia。解决方法可能是从批处理脚本启动Catia,该脚本在返回时将运行
test.bat

==runcatia.bat

SETLOCAL
SET EXITCODE=0

catia.exe
SET EXITCODE=%ERRORLEVEL%
"c:\windows\temp\test.bat"
EXIT /B %EXITCODE%