Windows Vista Forums

command ftp
  1. #1


    Naum Guest

    command ftp

    Hi,plz tell me why command:
    ftp -s:"c:\ftp.txt"
    in CMD work and in Powershell - it show me all options of ftp command and
    dont work.



      My System SpecsSystem Spec

  2. #2
    sapienscripter's Avatar

    Scripting Guru
    Join Date : Jun 2008
    Syracuse, NY
    Posts : 59
    Vista Ultimate 32bit
    Local Time: 03:04 PM
    usa us new york

     

    Re: command ftp

    That's an excellent question. It doesn't make sense other than a bug of some sort. Here's a work around for PowerShell:

    cmd /c 'ftp -s:c:\ftp.txt'

      My System SpecsSystem Spec

  3. #3
    sapienscripter's Avatar

    Scripting Guru
    Join Date : Jun 2008
    Syracuse, NY
    Posts : 59
    Vista Ultimate 32bit
    Local Time: 03:04 PM
    usa us new york

     

    Re: command ftp

    I stumbled upon a fix:

    ftp '-s:ftp.txt'

    Not sure why this is required for this parameter other than maybe something with the PowerShell parser that doesn't like the punctuation.

      My System SpecsSystem Spec

  4. #4
    sapienscripter's Avatar

    Scripting Guru
    Join Date : Jun 2008
    Syracuse, NY
    Posts : 59
    Vista Ultimate 32bit
    Local Time: 03:04 PM
    usa us new york

     

    Re: command ftp

    the PowerShell parser sees the -s and tries to parse it as a PowerShell parameter when it really isnt'. Use my fix to get around this. Another alternative is to use the free FTP com object from SAPIEN (SAPIEN Technologies, Inc. - VBScript Editor, PowerShell Editor, ASP Editor, ActionScript Editor, PHP Editor, and more.). Shay has some nice PowerShell functions also ready to go for this at $cript Fanatic: FTP transfers automation.

      My System SpecsSystem Spec

command ftp problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a command from inside a script, command line is corrupted Raymond Vought PowerShell 4 24 Feb 2009
What is the command line command for unzipping files? Jim H Vista General 0 03 Dec 2008
Solved Make a command prompt run a command as soon as it opens? PainlessTorture General Discussion 11 17 Nov 2008
Command Line Ren (Rename) command broken? SixSigmaGuy Vista General 5 20 May 2008
formatting command syntax like get-help or get-command klumsy@xtra.co.nz PowerShell 1 18 Oct 2006