I'd like to execute a script with options in a go-to-loop like so:
@echo off
rem my Array to loop thru
set Arr[0]=foo
set Arr[1]=bar
set Arr[2]=baz
set Arr[3]=bing
set Arr[4]=bang
After @Ken White's comment:
for /l %%x in (1, 1, 4) do (
set VAR=%%Arr[%%x]%%
"C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=C:\Dev\Automated_FTP_Scripts\%VAR%
rem works as echo:
call echo "C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=C:\Dev\Automated_FTP_Scripts\%VAR%
)
It still keeps returning the following error: Cannot open file "C:\Dev\Automated_FTP_Scripts\%Arr[0]%"
If I do a call echo ...
it shows the correct path tho...
I tried different things:
set VAR=C:\Dev\Automated_FTP_Scripts\ + %%me%%
set VAR="C:\Dev\Automated_FTP_Scripts\ + %%me%%"
set VAR=C:\Dev\Automated_FTP_Scripts\%%me%%
set VAR="C:\Dev\Automated_FTP_Scripts\%%me%%"
"C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=%%Arr[%%x]%%
The question: How can I pass all_path
to the winscp
option /script
?
One problem is that I don't know how to google that; I always get results on how to pass a parameter to a .bat file