So, I'm trying to write a batch file that will take my input, slot it into a template that I've created, and put that into a text file.
set Output="%USERPROFILE%\desktop"
set /p VarOne=Example
echo ** %VarOne% ** > %Output%\%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt
This works fine, but if I do it like this, I get an access denied error:
set Output="%USERPROFILE%\desktop"
set FNAME="%Output%\%date:~-10,2%%date:~-7,2%%date:~-4,4%.txt"
set /p VarOne=Example
echo ** %VarOne% ** > %FNAME%
I'm pretty inexperienced so, forgive me if its obvious.
echo ** %VarOne% ** > "%FNAME%"