I spend a lot of time to searching for the answer but still cannot solve the problem
Problem: I need to run batch file with fileName that will check on my pc if i have framework installed if yes it will make a fileName_1.txt with a framework version if not i will have empty fileName_0.txt
What i done until now:
@echo off
set pcName=%1
for /f "tokens=1 delims=1" %%A in ('wmic product where "Name like '%%Microsoft .Net Framework 4.6%%'" get version') do set FrameworksVer=%%A
IF "%frameworksVer%"=="No Instance(s) Available" (
@echo Framework 4.6 Not exist >> c:\%pcName%_0.txt
) ELSE (
@echo %FrameworksVer% >> c:\%pcName%_1.txt
)
every loop in for assign everytime the variable
the answer is always fileName_1.txt with couple echo on...
how can i solve it?
tnx.