Create a txt file using batch file in a specific folder
You have it almost done. Just explicitly say where to create the file
@echo off
echo.>"d:\testing\dblank.txt"
This creates a file containing a blank line (CR + LF = 2 bytes).
If you want the file empty (0 bytes)
@echo off
break>"d:\testing\dblank.txt"
This code written above worked for me as well. Although, you can use the code I am writing here:
@echo off
@echo>"d:\testing\dblank.txt
If you want to write some text to dblank.txt then add the following line in the end of your code
@echo Writing text to dblank.txt> dblank.txt
Changed the set to remove % as that will write to text file as Echo on or off
echo off
title Custom Text File
cls
set /p txt=What do you want it to say? ;
echo %txt% > "D:\Testing\dblank.txt"
exit