Active Directory
(1)
Windows Server
(1)
VBScript
(1)
FTP
(1)
ActionScript
(1)
JeffHicks
(1)
Frameworks
(1)
Director
(1)

command ftp

Asked By Nau
02-Jul-08 11:08 AM
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.

command ftp

Asked By Marco Shaw [MVP]
02-Jul-08 11:22 AM
Try simply:
PS> ftp `-s:"c:\ftp.txt"

PowerShell is trying to parse the dash.  Escaping only it seems to work.

Marco

--
*Microsoft MVP - Windows Server - Admin Frameworks
https://mvp.support.microsoft.com/profile/Marco.Shaw
*PowerShell Co-Community Director - http://www.powershellcommunity.org
*Blog - http://marcoshaw.blogspot.com

That's an excellent question.

Asked By sapienscripter
03-Jul-08 01:23 PM
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'


--
sapienscripter

Coming Soon: 'Managing Active Directory with Windows PowerShell: TFM'
(http://www.sapienpress.com/ad.asp)

Windows PowerShell MVP

'My Blog' (http://blog.sapien.com/)
'FollowMe on Twitter' (http://www.twitter.com/JeffHicks)  :cool:

command ftp

Asked By sapienscripter
03-Jul-08 01:25 PM
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.


--
sapienscripter

Coming Soon: 'Managing Active Directory with Windows PowerShell: TFM'
(http://www.sapienpress.com/ad.asp)

Windows PowerShell MVP

'My Blog' (http://blog.sapien.com/)
'FollowMe on Twitter' (http://www.twitter.com/JeffHicks)  :cool:
the PowerShell parser sees the -s and tries to parse it as a
Asked By sapienscripter
03-Jul-08 02:54 PM
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.'
(http://www.primalscript.com/Free_Tools/index.asp)).  Shay has some nice
PowerShell functions also ready to go for this at '$cript Fanatic: FTP
transfers automation'
(http://scriptolog.blogspot.com/2007/09/ftp-transfers-automation.html).


--
sapienscripter

Coming Soon: -'Managing Active Directory with Windows PowerShell: TFM'
(http://www.sapienpress.com/ad.asp)-

'[image: http://www.scriptinganswers.com/_images/logo_mvp.gif]'
(http://www.scriptinganswers.com/_images/logo_mvp.gif)

'My Blog' (http://blog.sapien.com/)
'FollowMe on Twitter' (http://www.twitter.com/JeffHicks)  :cool:
Hi Naum,It seems ftp has no problems accepting the paramater using forward
Asked By Shay Levy [MVP]
08-Jul-08 07:48 AM
Hi Naum,


It seems ftp has no problems accepting the paramater using forward slash
instead:

ftp /s:"c:\ftp.txt"


---
Shay Levy
Windows PowerShell MVP
blog: http://scriptolog.blogspot.com



N> Hi,plz tell me why command:
N> ftp -s:"c:\ftp.txt"
N> in CMD work and in Powershell - it show me all options of ftp command
N> and
N> dont work.
command ftp
Asked By Shay Levy [MVP]
08-Jul-08 07:48 AM
Hi Naum,

It seems ftp has no problems accepting the paramater as /s instead:

ftp /s:"c:\ftp.txt"




---
Shay Levy
Windows PowerShell MVP
blog: http://scriptolog.blogspot.com



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