How to download to new folder with today date
Hi,
I'm new to WinSCP and to scripting so please forgive my lack of knowledge.
I have created a .bat file to automatically download several files from an FTP server. I have added this .bat file to Windows Task Scheduler so it will run several times each day.
Now I would like to know how to add a function to my .bat file that creates a new folder with the current date and time, then downloads the files into the newly created folder.
My .bat file currently looks like this:
Is there a way to have this same script create a new folder with today date and time in
Many thanks
I'm new to WinSCP and to scripting so please forgive my lack of knowledge.
I have created a .bat file to automatically download several files from an FTP server. I have added this .bat file to Windows Task Scheduler so it will run several times each day.
Now I would like to know how to add a function to my .bat file that creates a new folder with the current date and time, then downloads the files into the newly created folder.
My .bat file currently looks like this:
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\Users\xxxxxx\WinSCP.log" /ini=nul ^ /command ^ "open ftp://anonymous:anonymous%%40example.com@ftp.com.au/" ^ "cd /xxx/xxx/xxx/xxx" ^ "lcd ""C:\Users\Data""" ^ "get xxxx1.nc.gz" ^ "get xxxx2.nc.gz" ^ "get xxxx3.nc.gz" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) exit /b %WINSCP_RESULT%
C:\Users\Data
and then download the files there?
Many thanks