Topic "Error: '' is not recognized as an internal or external command"

Author Message


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 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>> '' 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.

Where it might be going wrong in the automation?

Thank you in advance. Smile
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Well, this is actually not WinSCP question at all.

If you put echo %PATH% before the, what output do you get? (when executed in Task Scheduler)

Anyway, as an workaround, just use a full path to, like:
"C:\Program Files (x86)\WinSCP\" /script...

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License