Topic "Unable to open script.txt"

Author Message
Guest




Hi, im using WinSCP3 in command mode. For an automated updaterun i create a script file. The loging onto the server works fine, but then the error message occurs: can't open xyz.txt (While xyz.txt is my script file)
C:\Programme\WinSCP3\WinSCP3.exe user@host.de /console /script=xyz.txt
xyz.txt is in C:\Programme\WinSCP3\
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
If you do not provide full path, then the path (or file name) it relative to current working directory. And it may not be the directory, where WinSCP is installed. Try to provide full part.
_________________
Martin Prikryl
Guest




prikryl wrote:
If you do not provide full path, then the path (or file name) it relative to current working directory. And it may not be the directory, where WinSCP is installed. Try to provide full part.


HI Martin,
unfortunatly that does not work. i've tried to vary the entry:
/script=c:\programme\winscp3\example.txt
answer unkown command "xxx(x=strange special charakters)"

or
/script="c:\programme\winscp3\example.txt"
answer unkown command
or
/script=programme\winscp3\example.txt
answer cannot open programme\winscp3\example.txt

saved the txt-file in the session stored working directory
/script=example.txt
answer cannot open example.txt

Do you have any other ideas?
udo
QSS
[View user's profile]

Joined: 2006-06-02
Posts: 7
Location: Albuqeurque
If you saved the file as "example.txt" then windows will add another .txt to that file name. Therefore the file name is actually example.txt.txt

In DOS mode do a DIR on the directory where your script is to see its "true" name.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Quote:
unfortunatly that does not work. i've tried to vary the entry:
/script=c:\programme\winscp3\example.txt
answer unkown command "xxx(x=strange special charakters)"

I would suspect that you have saved the script file in Unicode encoding. Haven't you?
_________________
Martin Prikryl
Guest




QSS wrote:
If you saved the file as "example.txt" then windows will add another .txt to that file name. Therefore the file name is actually example.txt.txt

In DOS mode do a DIR on the directory where your script is to see its "true" name.


Hm interesting, i know about this doubeling but this maschine has still win nt 4 as os
and this is an effect under win xp...
Guest




prikryl wrote:
Quote:
unfortunatly that does not work. i've tried to vary the entry:
/script=c:\programme\winscp3\example.txt
answer unkown command "xxx(x=strange special charakters)"

I would suspect that you have saved the script file in Unicode encoding. Haven't you?


Yes i've saved the script.txt as unicode - but do so or not makes no effect

udo
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Can you email me the script?
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
1) The file had leading byte-order-mask of UTF-16 Unicode encoding. WinSCP does not support Unicode encodings.

2) Even if it does, the file had not correctly encoded line endings. It looked like if you have saved the file in UTF-16 and then opened it in another editor does does not support UTF-16 and saved it again. Or smething similar.
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