master.dbo.xp_cmdshell is failing

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Aman (Aman_at_discussions.microsoft.com)
Date: 07/12/04


Date: Mon, 12 Jul 2004 10:26:02 -0700

Please help !

I run an ftp task which picks up a file from an ftp server through a package it runs fine - no errors.

If I schedule the same dts or if I run the following code in query analyser it fails

declare @cmd varchar(2000)
declare @ftpcommandfile varchar(2000)

        --Get list of remote files
        set @ftpcommandfile = '-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dialer_Files\GetDialerFile.txt'
set @cmd = 'ftp -i -s:' + @ftpcommandfile

Exec master.dbo.xp_cmdshell @cmd

I get the following message:

output ---------------------------------------------------------------
Error opening script file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dialer_Files\GetDialerFile.txt.

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

  -v Suppresses display of remote server responses.

  -n Suppresses auto-login upon initial connection.

  -i Turns off interactive prompting during multiple file

                  transfers.

  -d Enables debugging.

  -g Disables filename globbing (see GLOB command).

  -s:filename Specifies a text file containing FTP commands; the

                  commands will automatically run after FTP starts.

  -a Use any local interface when binding data connection.

  -A login as anonymous.

  -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.

  -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.

  -b:async count Overrides the default async count of 3

  -w:buffer size Overrides the default transfer buffer size of 65535.

  host Specifies the host name or IP address of the remote

                  host to connect to.
Notes:
 - mget and mput commands take y/n/q for yes/no/quit.
  - Use Control-C to abort commands.
NULL



Relevant Pages

  • How to add FTP server as installation source for YAST
    ... One way, of course, is to browse around on the ftp server and install ... The way to do it with YAST is simple but a lot of people (including ... After the list has been read, you can choose the package to be ...
    (alt.os.linux.suse)
  • RE: How can I achieve the foll in dts
    ... The package does not automatically have to fail. ... You could also set up the package to allow n errors before failing. ... so automatically stopping the rest of your DTS ... I need to download a file from an ftp server via my dts package. ...
    (microsoft.public.sqlserver.dts)
  • TSLSA-2003-0037 - proftpd
    ... Package name: proftpd ... Affected versions: TSL 1.2, 1.5, 2.0 ... ProFTPd is an enhanced FTP server with a focus toward simplicity, ... security, and ease of configuration. ...
    (Bugtraq)
  • Re: [SLE] Finding files on the SuSE ftp site
    ... > find the package containing a specific file (an executable program or a ... Much of the time I can guess the right package ... Search for a file named "ARCHIVES.gz" on the ftp server. ... Also check the archives at http://lists.suse.com ...
    (SuSE)
  • Re: [SLE] Confused by downloadable DVD
    ... > listings of your main ftp server. ... > shows every package in the left column and then has every distribution ... > It seems there are a number of distribution methods. ... Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj ...
    (SuSE)