Problems with code--works calling from command line

Advertisement

Brent_badger
Joined:
Posts:
8
Location:
NC

Problems with code--works calling from command line

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?

Reply with quote

Brent_badger
Joined:
Posts:
8
Location:
NC

Re: Problems with code--works calling from command line

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.

Reply with quote

Advertisement

You can post new topics in this forum