![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest
Posts: n/a
| FTP Script After 10 minutes of frustration in ps, found the script I was using works just as it should in cmd.exe possibly something with the paramters? an overview of a ftp script http://support.microsoft.com/kb/96269 works ok CMD - ftp -s:ftpcommands.txt ------------------------------------------- throws up help for the ftp.exe PS - ftp -s:ftpcommands.txt ------------------------------------------- ------------------------------------------- throws up help for the ftp.exe (expected) CMD - C:\>ftp -s: ------------------------------------------- a different type of error (from powershell and not ftp.exe?) PS C:\> ftp -s: Parameter -s: requires an argument. At line:1 char:7 + ftp -s: <<<< |
| | #2 (permalink) |
| Guest
Posts: n/a
| Re: FTP Script Seems like a bug to me, but try putting the parameters inside quotes: ftp.exe '-s:ftpcommands.txt' ftp.exe "-s:ftpcommands.txt" or use a backtick escape character (under the ~tilde): ftp.exe `-s:ftpcommands.txt "JakeDAHS" <jskiba99@gmail.com> wrote in message news:1163620805.275275.156820@b28g2000cwb.googlegroups.com... > After 10 minutes of frustration in ps, found the script I was using > works just as it should in cmd.exe possibly something with the > paramters? > > an overview of a ftp script http://support.microsoft.com/kb/96269 > > works ok > CMD - ftp -s:ftpcommands.txt > ------------------------------------------- > throws up help for the ftp.exe > PS - ftp -s:ftpcommands.txt > ------------------------------------------- > ------------------------------------------- > throws up help for the ftp.exe (expected) > CMD - C:\>ftp -s: > ------------------------------------------- > a different type of error (from powershell and not ftp.exe?) > PS C:\> ftp -s: > Parameter -s: requires an argument. > At line:1 char:7 > + ftp -s: <<<< > |
| | #3 (permalink) |
| Guest
Posts: n/a
| Re: FTP Script Good call, thought I had tried with quotes before but just around the script filename. each of your answers worked properly. Thanks -J Marty List wrote: > Seems like a bug to me, but try putting the parameters inside quotes: > ftp.exe '-s:ftpcommands.txt' > ftp.exe "-s:ftpcommands.txt" > > or use a backtick escape character (under the ~tilde): > ftp.exe `-s:ftpcommands.txt > > > > "JakeDAHS" <jskiba99@gmail.com> wrote in message > news:1163620805.275275.156820@b28g2000cwb.googlegroups.com... > > After 10 minutes of frustration in ps, found the script I was using > > works just as it should in cmd.exe possibly something with the > > paramters? > > > > an overview of a ftp script http://support.microsoft.com/kb/96269 > > > > works ok > > CMD - ftp -s:ftpcommands.txt > > ------------------------------------------- > > throws up help for the ftp.exe > > PS - ftp -s:ftpcommands.txt > > ------------------------------------------- > > ------------------------------------------- > > throws up help for the ftp.exe (expected) > > CMD - C:\>ftp -s: > > ------------------------------------------- > > a different type of error (from powershell and not ftp.exe?) > > PS C:\> ftp -s: > > Parameter -s: requires an argument. > > At line:1 char:7 > > + ftp -s: <<<< > > |
| | #4 (permalink) |
| Guest
Posts: n/a
| Re: FTP Script Marty List wrote: > Seems like a bug to me, but try putting the parameters inside quotes: > ftp.exe '-s:ftpcommands.txt' > ftp.exe "-s:ftpcommands.txt" > > or use a backtick escape character (under the ~tilde): > ftp.exe `-s:ftpcommands.txt PowerShell's parser is a bit different than CMD.exe's. Which is good in some ways, because CMD.exe's was pretty nasty. I think they'll tell you it's a feature rather than a bug, but I agree it can be unintuitive to people expecting things to "just work". :-) |
| | #5 (permalink) |
| Guest
Posts: n/a
| Re: FTP Script Concurring with Adam, the issue here is the way PowerShell parses and reassembles command lines before passing them to external commands. It works fine with correctly-specified getopt() style options, but breaks any getopt style option specifications that take an argument - if I understand the man page correctly: http://node1.yo-linux.com/cgi-bin/ma...nd=getopt(3%29 Note that it works just fine with "/" specifiers, and that escaping the - with ` will also inhibit parsing. "Marty List" <usenet@optimumx.com> wrote in message news:u%23uC3MPCHHA.996@TK2MSFTNGP02.phx.gbl... > > Seems like a bug to me, but try putting the parameters inside quotes: > ftp.exe '-s:ftpcommands.txt' > ftp.exe "-s:ftpcommands.txt" > > or use a backtick escape character (under the ~tilde): > ftp.exe `-s:ftpcommands.txt > > > > "JakeDAHS" <jskiba99@gmail.com> wrote in message > news:1163620805.275275.156820@b28g2000cwb.googlegroups.com... >> After 10 minutes of frustration in ps, found the script I was using >> works just as it should in cmd.exe possibly something with the >> paramters? >> >> an overview of a ftp script http://support.microsoft.com/kb/96269 >> >> works ok >> CMD - ftp -s:ftpcommands.txt >> ------------------------------------------- >> throws up help for the ftp.exe >> PS - ftp -s:ftpcommands.txt >> ------------------------------------------- >> ------------------------------------------- >> throws up help for the ftp.exe (expected) >> CMD - C:\>ftp -s: >> ------------------------------------------- >> a different type of error (from powershell and not ftp.exe?) >> PS C:\> ftp -s: >> Parameter -s: requires an argument. >> At line:1 char:7 >> + ftp -s: <<<< >> > > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Include another script, keep variables in included script? | pschmidt | PowerShell | 32 | 3 Days Ago 01:48 PM |
| Windows Script Host has no script engine for ".js" files | Stephan G. | Vista General | 9 | 04-24-2008 03:04 PM |
| need of a script . | don5 | PowerShell | 7 | 02-05-2008 03:17 PM |
| Script file has 'OS Handle' error when run from script | Jay | PowerShell | 1 | 09-18-2007 07:06 PM |
| Can you drag-n-drop a file on top of a PS script to run the script? | Jen Taylor | PowerShell | 6 | 04-06-2007 09:02 AM |