Topic "Unknown command '_o'"

Author Message
raimiansch
[View user's profile]

Joined: 2011-03-22
Posts: 2
Hello together!

I want to automate file trasfer with winscp. But I always get the error
Unknown command '_o'

I use following command:

.\WinSCP.com /script=scp.txt

The content of scp.txt is:
option batch on
option confirm off
open nabackup@x9149.spar.local.at
bin
put C:\adm\VMbackup\VMware-ESX-aecpitsp01
put C:\adm\VMbackup\VMware-ESX-atsl-dmgr01
put C:\adm\VMbackup\VMware-ESX-atsl-ecpa02
exit

The output is:
C:\Program Files (x86)\WinSCP> .\WinSCP.com /script=scp.txt
Unknown command '_o'.
winscp>

When I open the winscp console (winscp.com) and try each command per hand, it works very fine.

I use the version
C:\Program Files (x86)\WinSCP>WinSCP.com /h
WinSCP, Version 4.3.2 (Build 1201)
Copyright (c) 2000-2011 Martin Prikryl

Can anybody help me please?

Thanks
Rainer
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25014
Location: Prague, Czechia
Make sure the script file is saved using UTF8 encoding.
_________________
Martin Prikryl
raimiansch
[View user's profile]

Joined: 2011-03-22
Posts: 2
prikryl wrote:
Make sure the script file is saved using UTF8 encoding.


Thank you for your help.

I used within powershell following code to create the text file.

echo "option batch on" >>scpcmd
echo "option confirm off" >>scpcmd
echo "open nabackup@x9149.spar.local.at" >>scpcmd
..


Now I use set-content instead of ">>scpcmd" and it works fine.

Thank you
Rainer
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25014
Location: Prague, Czechia
Basic PowerShell example added
https://winscp.net/eng/docs/library#powershell
More examples (and syntax highlighting) coming soon.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License