Text File Cannot read by Batch File
- by Typowarrior
I have the problem where TXT file that batch create can't be read. it turns to ECHO OFF Result.
Here is 1st code need to be run.
echo.
wmic /output:huhu.txt Path CIM_DataFile WHERE Name='C:\\Users\\uJaNbaTus\\Desktop\\HyperTerminal.exe' Get Version
echo.
Then I create another .bat file with this code and run it.
echo.
setlocal ENABLEDELAYEDEXPANSION
set revision=
for /f "delims=" %%a in (huhu.txt) do (
set line=%%a
if "x!line:~0,8!"=="xVersion " (
set revision=!line:~8!
)
)
echo !revision!
echo.
endlocal
When I run this .bat file the result Showing ECHO off. Btw if I create another file using notepad and replace (huhu.txt) I didn't get any error and the output come from txt file.