Home > Archive > SQL Anywhere database > June 2005 > xp_cmdshell









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xp_cmdshell
Stephen

2005-06-28, 3:23 am

Hi,

In ASA 8.02 i FTP doing the following in an Event...

CALL xp_cmdshell ( 'ftp -i -v -n -s:c:\FTP\download.ftp');

....the prblem is that the files that i am getting don't get placed in the
directory of my choice.

How do is say 'cd c:\FTP\IN\' setting the directory for the files to be
FTP'd into.
can this be done in one line ?

Thanks


Martin Baur

2005-06-28, 7:23 am

In article <42c1075a$1@forums-1-dub>, stephen@targetonline
solutions.co.uk says...
> CALL xp_cmdshell ( 'ftp -i -v -n -s:c:\FTP\download.ftp');
>
> ...the prblem is that the files that i am getting don't get placed in the
> directory of my choice.
>
> How do is say 'cd c:\FTP\IN' setting the directory for the files to be
> FTP'd into. can this be done in one line ?


Why not calling a batch file that does the cd ... and ftp ..?

Martin
Mark Culp

2005-06-28, 1:23 pm

As Martin has suggested, the basic principle is to do this in a batch,
but depending on your platform (and shell being used), you can do this
in the command string that is passed to xp_cmdshell.

For example, on Windows (XP), you could use:
xp_cmdshell( 'cmd /c "c: & cd \ftp\in\ & ftp -i -v -n ...<etc>..."' );
and on UNIX (for completeness sake for anyone else reading this thread in the
future), you could use:
xp_cmdshell( '/bin/sh -c "cd /ftp/in; ftp -i -v -n ...<etc>..."' );
--
Mark Culp
SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------

Stephen wrote:
>
> Hi,
>
> In ASA 8.02 i FTP doing the following in an Event...
>
> CALL xp_cmdshell ( 'ftp -i -v -n -s:c:\FTP\download.ftp');
>
> ...the prblem is that the files that i am getting don't get placed in the
> directory of my choice.
>
> How do is say 'cd c:\FTP\IN' setting the directory for the files to be
> FTP'd into.
> can this be done in one line ?
>
> Thanks

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com