I am working on a batch file right now and I have everything done that I need but I'm stuck at one point. One of the programs I use spits out a log file and I have it place this file on the C:drive in a folder. What I want to do is have it read this .txt and spit that back into the batch file as an echo.
For the file name, type test. bat and if your version of Windows has a Save as type option, choose All files, otherwise it saves as a text file. Once you have completed these steps, click the Save button and exit notepad. To run the batch file, double-click it like any other program.
Using a BAT file in Windows is as simple as double-clicking or double-tapping it. You don't need to download any special program or tool. To use the first example from above, entering that text into a text file with a text editor and then saving the file with the .
Use double percent signs ( %% ) to carry out the for command within a batch file. Variables are case sensitive, and they must be represented with an alphabetical value such as %a, %b, or %c. Required. Specifies one or more files, directories, or text strings, or a range of values on which to run the command.
Output: The > operator is used to overwrite any file that already exists with new content. The >> operator is used to append to the text file (add to), instead of overwriting it.
You can put this in your batch file:
type C:\folder\test.txt
This will echo out the contents of test.txt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With