LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert a .txt file into a .bat file

Solved!
Go to solution

hello, i have this .bat file from whhich i run an .exe application and i want to use labview to change some parameters in the file using strings. i didnt find any function to directly build a .bat file so i tought i could build a .txt file and then convert it to .bat in some way. how could i do?

thanks a lot

0 Kudos
Message 1 of 4
(9,675 Views)
Solution
Accepted by topic author domcorrado

Hi dom,

 


@domcorrado wrote:

i didnt find any function to directly build a .bat file so i tought i could build a .txt file and then convert it to .bat in some way. how could i do?


So you know a .bat file consists of pure text and you already create a .txt file?

I see two options:

  1. Use the FileRename function to rename your file.txt to file.bat. Sounds quite easy!?
  2. Instead of create a file.txt you can use the very same WriteText function to save your text into the file.bat. Sounds even easier...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(9,662 Views)

If you have a notepad, Save file as and then select "All files" as file type. After that just append .bat to your file name (don't forget to delete .txt!) and it should show up as batch file.

 

Or if you have notepad++ or similar, you can directly choose Batch file as a file type and save it as such.

0 Kudos
Message 3 of 4
(9,659 Views)

batch file.png

 

Of course you can use each and every file function in a similar way, providing you know how to use those functions... 

0 Kudos
Message 4 of 4
(9,606 Views)