10-09-2008 01:16 AM
hi, How can i open a text file in a textpad or notepad on the click event of a button.?
Thanks
Jay
10-09-2008 01:22 AM
Use System Exec.vi and the following command line:
notepad.exe "<path to the file>"
You have to use the double quotation marks if the path contains any blanks.
For starting the default application for a file, like when double clicking in Windows Explorer, you have to use the shellexecute WinAPI function.
10-09-2008 03:57 AM
waldemar.hersacher wrote:For starting the default application for a file, like when double clicking in Windows Explorer, you have to use the shellexecute WinAPI function.
I think you only have to write the path of the file at System Exec.vi (it is easier)
10-09-2008 03:43 PM - edited 10-09-2008 03:48 PM
Pnt,
this will not work LV 8.0.1 and LV 8.6 will give back error 193.
Attached is a VI to use the ShellExecute WinAPI. The VI is LV 7.1.1.
10-10-2008 01:29 AM
You are right.
I looked in my vis and here is how is done... (see picture). Needs something more.
What does "Verzeichnis" mean ?
Thanks for the vi
10-10-2008 05:55 AM
Pnt,
I just packed it an forgot it is in German. "Verzeichnis" is the directory/folder where the file is located. I think I have to change that to English this evening.