IMSpexec应用程序调用一个Project文件(.lib),处理Input文件(.aptsource),生产Output文件(.nc),后面是一些参数 /I:A /C:15 /V:2
我在CMD环境中可以执行成功,但在VB中不行。
CMD:
C:\Program Files\IMSpost73c>IMSpexec.exe c:\STC1000.lib C:\Test_BladeF_1.aptsource C:\Test.nc /I:A /C:15 /V:2
VB中Shell应该怎么写?下面是我写的,请纠正!
Shell ("C:\Program Files\IMSpost73c\IMSpexec.exe TxtPostProcessor.text ToolPathFile C:\testnc.nc /I:A /C:15 /V:2")
我在CMD环境中可以执行成功,但在VB中不行。
CMD:
C:\Program Files\IMSpost73c>IMSpexec.exe c:\STC1000.lib C:\Test_BladeF_1.aptsource C:\Test.nc /I:A /C:15 /V:2
VB中Shell应该怎么写?下面是我写的,请纠正!
Shell ("C:\Program Files\IMSpost73c\IMSpexec.exe TxtPostProcessor.text ToolPathFile C:\testnc.nc /I:A /C:15 /V:2")
ChDrive App.Path
ChDir App.Path
将其改为当前目录操作
注意处理变量及变量中的空格Shell ("C:\Program Files\IMSpost73c\IMSpexec.exe " & Chr(34) & TxtPostProcessor & Chr(34) & " " & Chr(34) & ToolPathFile & Chr(34) & " " & Chr(34) & NCFile & Chr(34) & "/I:A /C:15 /V:2")
strtemp="C:\Program Files\IMSpost73c\IMSpexec.exe TxtPostProcessor.text ToolPathFile C:\testnc.nc /I:A /C:15 /V:2"
shell strtemp
有空格的命令或参数必须用双引号括起来,否则就在空格处分割了。