I've been trying to write a batch file that would move all
.xlsxfiles to the
archivefolder, but it keeps failing. Could someone let me know what I'm doing wrong?
I've replaced my site info with test information since this has to do with my work. All of that information is correct since I got it from WinSCP.
I keep getting a error code 2. It says it cannot locate the file. I believe I am navigating to the file correctly. Any help would be appreciated.
@echo off "C:\Users\kdixit\AppData\Local\Programs\WinSCP\WinSCP.com" ^ /log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^ /command ^ "open sftp://test:firstname.lastname@example.org/ -hostkey=""ssh key here"" -rawsettings ProxyPort=0" ^ "cd /home/Reports/" ^ "mv *.xlsx /home/Reports/Archive/" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Attempt Failed!!! ) exit /b %WINSCP_RESULT%