Batch file download called in VBA (Access) downloads to different directlry
I have a batch file (see below) that downloads files to the directory where the batch file exists. It works great, no problems.
The problem arises when I call the batch file from inside Access with the following command. It runs the batch file, but the files get downloaded to my local
Batch file contents
The problem arises when I call the batch file from inside Access with the following command. It runs the batch file, but the files get downloaded to my local
Downloads
directory, not the current directory. Is this something that I can/should fix inside the batch file itself?
myPath = CurrentProject.Path & "\GetFiles.bat" Call Shell(myPath, 1)
@echo off "C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="WinSCP.log" /ini=nul ^ /command ^ "open sftp://XXXXXX/ -hostkey=""ssh-rsa 2048 YYYYYY"" -rawsettings ProxyPort=0" ^ "cd outgoing" ^ "get *" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) exit /b %WINSCP_RESULT%