Topic "URGENT - "put -nopreservetime" in script does not work, HELP"

Author Message
rmundkowsky
[View user's profile]

Joined: 25 Mar 2006
Posts: 6
Hi, I am using 4.1.8. in interactive command line interface mode, the commands listed below work. But if I put them into a script file and run them then Winscp thinks "-nopreservetime" and "nopermissions" are file names rather than an option. I am using SFTP. I would note that we are using the old INI file that can with version 3, not sure if that makes a difference.

SCRIPT:
option batch on
option batch abort
option confirm off
open AAAA:BBB@XYZ.com
lcd C:\temp\t
lls
cd IN
put -nopreservetime nopermissions "test.zip"
ls
bye


PARTIAL OUTPUT FROM LOG:
...
. 2009-03-24 11:34:01.134 Asking user:
. 2009-03-24 11:34:01.134 File or folder 'nopermissions' does not exist. ()
* 2009-03-24 11:34:01.149 (EScpSkipFile) File or folder 'nopermissions' does not exist.
. 2009-03-24 11:34:01.149 Closing connection.
. 2009-03-24 11:34:01.149 Closing connection.


Command line usage:
"c:\Program Files\WinSCP\WinSCP.com" AAAA:BBB@XYZ.com /ini=z:\Admin\INI_files\WinSCP3.ini /script=s.txt /log=test.log
Advertisements
rmundkowsky
[View user's profile]

Joined: 25 Mar 2006
Posts: 6
Found a work around which is to use a INI file with the following, but I think this is a bug that you should still address.

FileNameCase=0
PreserveReadOnly=0
PreserveTime=0
PreserveRights=0
IgnorePermErrors=1



rmundkowsky wrote:
Hi, I am using 4.1.8. in interactive command line interface mode, the commands listed below work. But if I put them into a script file and run them then Winscp thinks "-nopreservetime" and "nopermissions" are file names rather than an option. I am using SFTP. I would note that we are using the old INI file that can with version 3, not sure if that makes a difference.

SCRIPT:
option batch on
option batch abort
option confirm off
open AAAA:BBB@XYZ.com
lcd C:\temp\t
lls
cd IN
put -nopreservetime nopermissions "test.zip"
ls
bye


PARTIAL OUTPUT FROM LOG:
...
. 2009-03-24 11:34:01.134 Asking user:
. 2009-03-24 11:34:01.134 File or folder 'nopermissions' does not exist. ()
* 2009-03-24 11:34:01.149 (EScpSkipFile) File or folder 'nopermissions' does not exist.
. 2009-03-24 11:34:01.149 Closing connection.
. 2009-03-24 11:34:01.149 Closing connection.


Command line usage:
"c:\Program Files\WinSCP\WinSCP.com" AAAA:BBB@XYZ.com /ini=z:\Admin\INI_files\WinSCP3.ini /script=s.txt /log=test.log
prikryl
[View user's profile]
Site Admin
Joined: 10 Dec 2002
Posts: 19063
Location: Prague, Czech republic
Are you sure you are using the same version of WinSCP when run interactively and when running the script?
There may also be some syntax problem in the script. I've noticed that in the post the dash before nopreservetime is different to the one before nopermissions. And as WinSCP does report the error for nopermissions although it is only after nopreservetime, I guess it may be the actual problem.
_________________
Martin Prikryl
rmundkowsky
[View user's profile]

Joined: 25 Mar 2006
Posts: 6
Wow,

Good catch. By some strange accident, I used a 0x96 rather than a 0x2D for a dash. Wierd, I thought I was using a Ascii Text file for the script, but I guess it is an Unicode file.
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