LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to open notepad file from labview?

My application requires a txt file to be opened and displayed.
the problem is, we are able to launch the notepad using "systemexec.vi".
but we want to launch the notepad with the appropraite file opened along with
launching of notepad.exe.

we don't want the user to interact with the "open file dialouge box" of
the note pad appliation.we just want the user to view directly the
required txt file.

how can we achive this?

rags
0 Kudos
Message 1 of 10
(4,862 Views)
Hi Rags

notepad accept commad line argumets so you can call it passing arguments such as the file name to open.
Try this "notepad.exe " at the command line input of the system exec function.

Bye,

Alessandro.
Alessandro Ricco
0 Kudos
Message 2 of 10
(4,846 Views)
Hi,
All you have to do is use the "systemexe.vi" and generate a path like for example :- notepad.exe "C:\Documents and Settings\viveks\Desktop\ftp.txt" this is given to the command line argument in systemexe.vi this will do your job.
cheers
vicky
0 Kudos
Message 3 of 10
(4,840 Views)
If you only want to display a text file you can load it and use a string indicator inside Labview. So your user will never have to deal with notepad.exe (as he can access the menu of notepad anyway...).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(4,836 Views)
Hi

I am not able to open the txt file, my text file is palced
at the path mentioned below "C:\Documents and Settings\raghavendra\Desktop\report.txt".

if i pass the above mentioned path to the command line argument in systemexec.vi
it generates error.

i have no problem opening "notepad.exe".....but iwant the report.txt to
be opened when i open notepad.

thanks

rags
0 Kudos
Message 5 of 10
(4,831 Views)
Hello Rags,

you're not able to open the report? Why? Can notepad open the text file? Can Labview open the textfile?
Why do you want to display the text using notepad?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,822 Views)
Hi,
Your command should be .... notepad.exe "C:\Documents and Settings\raghavendra\Desktop\report.txt" ... not only the path,try this it shall work.
cheers
vicky
0 Kudos
Message 7 of 10
(4,817 Views)
hi Gerd

see the requirement is from the client...so i have to make sure the
txt file is opened when notepad is launched......


i am getting error if pass this at command line argument "C:\Documents and Settings\raghavendra\Desktop\report.txt"

do you havae any idea GRED!

rags
0 Kudos
Message 8 of 10
(4,815 Views)
Hello rags,

what vicky says works, for me even without the quotation marks...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(4,812 Views)
HI vicky....

Thanks a LOtttttttttttttttttttt
its working..and thanks once again


rags
0 Kudos
Message 10 of 10
(4,811 Views)