Someone help me to create a batch file to extract information from a file and create another with that information?
The file "version.log" contains only the information "v1.0"
I want to create a text file with that information "v1.0.txt"
This should work just fine:
@echo off
set /p VERSION= < version.log
echo "nothing" > "%VERSION%.txt"
touch
first, but couldn't come up with the Windows equivalent. Thanks! :)
Jul 6, 2012 at 21:31
XYZ
@echo off
setlocal
set FILE=log.txt
:: Read first line of the file
for /F "tokens=*" %%x in (%FILE%) do (set STR=%%x) && (goto out)
:out
fsutil file createnew %STR% 0
pause 1>nul