![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| | |||||||
| | Vista - FTP Script |
| |
| 11-15-2006 | #1 (permalink) |
| | 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: <<<< |
| My System Specs |
| 11-15-2006 | #2 (permalink) |
| | 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: <<<< > |
| My System Specs |
| 11-15-2006 | #3 (permalink) |
| | 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: <<<< > > |
| My System Specs |
| 11-15-2006 | #4 (permalink) |
| | 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". :-) |
| My System Specs |
| 11-17-2006 | #5 (permalink) |
| | 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: <<<< >> > > |
| My System Specs |
| Thread Tools | |
| |
| Similar Threads for: FTP Script | ||||
| Thread | Forum | |||
| Logon Script Causing Laptops To Hang - Problems in script? | VB Script | |||
| problem passing args to script 'There is no script engine for file extenstion' | VB Script | |||
| Include another script, keep variables in included script? | PowerShell | |||
| Script file has 'OS Handle' error when run from script | PowerShell | |||
| Can you drag-n-drop a file on top of a PS script to run the script? | PowerShell | |||