Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripted FTP

Status
Not open for further replies.

gurner

Technical User
Feb 13, 2002
522
US
any idea why when i run a scripted FTP download with this in a text file;

username
password
cd logs
cd W3SVC135
bin
hash
mget *.*
quit

which is called by a batch file with this in it;

ftp -i -s:websiteftpcmd.txt -a
As soon as it gets to 'mget *.*' it errors on 'Invalid PORT Command'

Yet if i type exactly the same commands manually it works fine?

very strange

Cheers



Gurner

 
try adding a line before mget *.* containing

prompt


-------------------------------

If it doesn't leak oil it must be empty!!
 
I agree with Norton. The prompt command will turn interactive mode off so no user intervention is required. Also have you just tried a plain 'get'?
 
cheers for your suggestions, however neither worked.

the Get one didn't do anything, and the interactive mode still said 'Invalid PORT Command' after mget.



Gurner

 
Gurner,
Try your FTP manually again and type the command "prompt" after hash, and before mget. Once you do your FTP, logoff of the server properly and try to run your automated script ( just how you have it ) again. I'm not sure if this will help you, but I'm just trying to troubleshoot the problem. Let me know how it goes.
 
found one that works, thanks

this in a VBS script

-------------

Dim objFso
Dim objShell
Dim strInstructions
Dim strHost
Dim strUser
Dim strPassword

Set objFso = WScript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
strInstructions = "C:\Instructions.ftp"
strHost = "strUser = "username"
strPassword = "password"

With objFso
With .CreateTextFile(strInstructions, True)
.WriteLine "open " & strHost
.WriteLine "user " & strUser
.WriteLine strPassword
.WriteLine "lcd E:\stats\log stage"
.WriteLine "cd logs"
.WriteLine "mget *.*"
.WriteLine "close"
.WriteLine "quit"
.Close
End With
objShell.run "%windir%\system32\ftp.exe -i -n -s:" & strInstructions, 1, True
.DeleteFile strInstructions
End With

Set objShell = Nothing
Set objFso = Nothing

---------------



Gurner

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top