Error: 'winscp.com' is not recognized as an internal or external command
I have WinSCP (version 5.9.1) installed on our Windows Server (Windows Server 2008 R2 Datacenter. Service Pack 1). The WinSCP is installed in C:\Program Files (x86)\WinSCP\ and WinSCP.exe and WinSCP.com sit in this same folder. The System Varibale Path also consist if this directory.
I am trying to automate the file upload (SFTP) using a batch (.bat) file. If I run the batch file using Task Scheduler then the following Error is thrown:
error>> 'winscp.com' is not recognized as an internal or external command,
error>> operable program or batch file.
error>> Access is denied.
But if I run the batch file manually by clicking on it then the file transfer is successful and without any issue.
I have also checked the System Environment variable for the whole system and the path of the WinSCP directory is included in that as well.