Topic "Problems with code--works calling from command line"

Author Message
Brent_badger
[View user's profile]

Joined: 2009-11-06
Posts: 8
Location: NC
I have a batch file that calls a script. Here is the batch file in particular:
cd\
cd "\Program Files (x86)\winscp"
winscp.com /script=C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\FTPCREDITSCRIPT-201106161650181308257418985.txt

And here is the script:
option batch on
option confirm off
open badger1:badger1*2010@12.169.193.146
put C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\PEND0416_201106161650181308257418985.txt
A
exit


If I run the batch file at the beginning from a command prompt (Windows 2003 Enterprise 64-bit, using WInSCP 4.3.3) it runs fine.

If I call it from a Java app, it gets that annoying "Timeout waiting for external Console to complete command"

I saw the article concerning that, but I don't see how calling a simple batch file from Java and calling it from the command line would make a difference. Can someone enlighten me on this so I can get with our programmers, or maybe adjust the settings in Windows?
Brent_badger
[View user's profile]

Joined: 2009-11-06
Posts: 8
Location: NC
Brent_badger wrote:
I have a batch file that calls a script. Here is the batch file in particular:
cd\
cd "\Program Files (x86)\winscp"
winscp.com /script=C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\FTPCREDITSCRIPT-201106161650181308257418985.txt

And here is the script:
option batch on
option confirm off
open badger1:badger1*2010@12.169.193.146
put C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\PEND0416_201106161650181308257418985.txt
A
exit


If I run the batch file at the beginning from a command prompt (Windows 2003 Enterprise 64-bit, using WInSCP 4.3.3) it runs fine.

If I call it from a Java app, it gets that annoying "Timeout waiting for external Console to complete command"

I saw the article concerning that, but I don't see how calling a simple batch file from Java and calling it from the command line would make a difference. Can someone enlighten me on this so I can get with our programmers, or maybe adjust the settings in Windows?



Okay, I talked with our software developers and they gave me some insight as to what was happening. Their Java code was not reading the buffer because doing so was unnecessary. I changed the line:

winscp.com /script=C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\FTPCREDITSCRIPT-201106161650181308257418985.txt

to

winscp.com /script=C:/tomcat_ee8idbbdt/webapps/xssqlbdt/jomar/BBTRequests\FTPCREDITSCRIPT-201106161650181308257418985.txt >winscp.txt

and it works just fine. Unless I see any other problems, I would say this problem is solved. Thanks anyway.
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