I am automating some processes on a Windows server, and I would like to create some .bat files for this, but for that it would be necessary for the .BAT to be read from a configuration file so I did the following:
file get.bat:
@echo off
setlocal
@if not exist "%1" (
echo Config file not found in "%1"
exit /B
)
@for /f "tokens=1,2 delims= " %%A in (%1) do (
set %%A=%%B
)
echo %folder%
and created a configuration file called winscp.conf with the following data:
folder %appData%\winscp
version 5.7.4
visit http://sourceforge.net/projects/winscp/files/WinSCP/
download http://sourceforge.net/projects/winscp/files/WinSCP/5.7.4/winscp574.zip
and then I call .bat like this:
get winscp.conf
So far, the variable is read and created exactly as I would like it to be, but this is in the use of environment variables, I would like the app data to be interpreted and stored in the variable but instead of having something like this
C:\Users\root\AppData\Roaming\winscp
I get this:
%appData%\winscp
In short: I'd like% appData% to be interpreted but instead I'm getting the literal value.
Can anyone help?