.NET Framework - 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.
Active Directory
(1)
Windows Server
(1)
VBScript
(1)
FTP
(1)
ActionScript
(1)
JeffHicks
(1)
Frameworks
(1)
Director
(1)
  Marco Shaw [MVP] replied...
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
  sapienscripter replied...
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:
  sapienscripter replied...
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:
  sapienscripter replied...
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:
  Shay Levy [MVP] replied...
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.
  Shay Levy [MVP] replied...
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.
Create New Account
help
Add an Active Directory Object to Organizational Unit !!!! .NET Framework Hi everyBody , I want to add an Active Directory Object (User Acount , Group , Compturer. . .) to an OU by using PowerShell , and i do not know How , any help will be apreciate . thanks . Powershell Discussions Active Directory (1 Windows 7 (1) QADUser (1) ParentContainer (1) ScriptCenter (1) UserPassword (1) CompanyOU (1) VMs (1) use user1' -ParentContainer 'OU = companyOU, DC = company, DC = com' -UserPassword 'P@ssword' 3) If you have Windows 7 RSAT & Server 2008 R2 Domain Controllers (or have added the Web Services component to
Wanna practice searching an Active Directory, but . . . .NET Framework As a practice, I would like to program searching users in an active directory. But I don't have a domain controller at home. So I am wondering if there is anything out there that simulates an active directory? Any pointer is highly appreciated. C# Discussions Virtual PC (1) Active Directory (1) Windows (1) Simulates (1) You can run a Virtual Machine inside your PC (using
How to access Active Directory from web application? .NET Framework Hi How should I go about accessing a Active Directory from a web application? I need to display a list of users from a Active Directory on a public website. Since the web application and the Active Directory are on separate domains I don't think the web application can access the Active
Role-based authentication from active directory .NET Framework Hello, I want certain pages of my website visible only to a particular role in the network (Active Directory) How do I check for authentication from active directory (role-based) Eg- - I want the only managers in the active directory to access a particular page. Please provide me some code by which I can achieve
Active users from Active Directory .NET Framework I am looking for a piece of code which retrieves the list of active users from active directory. Anybody? thanks C# Discussions System.Text.Encoding.ASCII (1) SMTPMail.SendFileAsAttachment (1) Active Directory (1) LoginInitials.EndsWith (1) Path.GetDirectoryName (1) ToShortDateString (1) Excel (1) System.DirectoryServices (1) What