Unable to open script.txt

Advertisement

Guest

Unable to open script.txt

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\

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Unable to open script.txt

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.

Reply with quote

Guest

Re: Unable to open script.txt

martin 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

Reply with quote

QSS
Joined:
Posts:
7
Location:
Albuqeurque

txt.txt

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Unable to open script.txt

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?

Reply with quote

Advertisement

Guest

Re: txt.txt

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

Reply with quote

Guest

Re: Unable to open script.txt

martin wrote:

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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Unable to open script.txt

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.

Reply with quote

Advertisement

You can post new topics in this forum