From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



使用LaunchExecutableEx, LaunchExecutable 或者System Functions 来查看数据文件时发生错误



主要软件: LabWindows/CVI Development Systems>>LabWindows/CVI Base Package
主要软件版本: 7.1
主要软件修正版本: N/A
次要软件: N/A

问题:

当我在CVI中使用LaunchExecutableEx, LaunchExecutable, 或 System Functions 来打开一个文件时,发生错误。我尝试通过使用完整路径 "C:\Windows\Desktop\data.txt"来打开一个文本文件。我可以通过开始》运行选项来打开同样的文件,或者在windows系统中双击就可以。

 



解答:

windows系统运行某种类型的文件通过特定的应用程序打开,所以在双击该文件时,可以自动用指定的应用程序打开。比如说,文本文件可以与Word或者是IE关联。然而,CVI不能使用这个特性来建立应用。

CVI中的LaunchExecutableEx, LaunchExecutable, 或 System Functions 使用对象只能是可执行文件(.exe),批处理文件(.bat)或者是命令文件(.com)。然而如果你先打开一个特定的程序,该文件就可以从外部打开。比如要打开存放在C盘根目录下一个叫data.txt的文件,使用以下命令:

C:\{notepad.exe完整路径}\Notepad.exe c:\data.txt

确保在LaunchExecutableEx, LaunchExecutable, 或 System Functions 中使用完整路径来指向任何文件。



相关链接: KnowledgeBase 2W3EOHY1 . What is the Difference Between System( ) and LaunchExecutable( ) in CVI?

LabWindows/CVI Support Homepage

附件:





报告日期: 06/21/2001
最近更新: 02/28/2015
文档编号: 2AKCHNYF