I've created the following config file which contains parameters to be used by a batch file:
File winscp.conf:
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
Batch 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
)
mkdir %folder%
When I call the batch file like this:
get.bat winscp.conf
I get a sub-folder %appData%\winscp created in the current folder, something like this:
c:\Temp\%appData%\winscp
While what I want is a winscp folder created in the Windows app data folder, something like this:
C:\Users\Caffe\AppData\Roaming\winscp
I think there's something wrong with the statement set %%A=%%B, since if I change it to set %%A=%appData%\winscp I do get the folder created the way I want.