Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Could someone please help me create a DOS batch file that performs the following commands?
ftp.exe
ENTER
lcd c:/ftp_temp
ENTER
open 192.168.1.1
ENTER
johndoe
ENTER
pasword1
ENTER
cd audit_dumps
ENTER
get file001.prt
ENTER
bye
ENTER
exitThanks!
REMGU
Thanks,
REMGU

I suppose "lcd c:/ftp_temp" is a typo and what you really want is:
cd c:\ftp_temp
try this:
::==
@echo offcd c:\ftp_temp
> my.ftp echo o 192.168.1.1
>> my.ftp echo johndoe
>> my.ftp echo password
>> my.ftp echo bin
>> my.ftp echo cd audit_dumps
>> my.ftp echo get file001.prt
>> my.ftp echo byeftp -s:my.ftp
::==
=====================================
If at first you don't succeed, you're about average.M2

Hi thanks but no I actually do use
"lcd" to have the ftp'ed file go to that location. "cd" would simply take me to that directory but not transfer the file there, right?Thanks,
REMGU

Thanks Mechanix2Go, "cd" works as well. It must have been a typo.
How would you go about setting it up if I want to have the batch file wait for a user input instead of executing the part below? I ask because the file name will not always be the same so if I could get the user to specify it, that would be great.
">> my.ftp echo get file001.prt"
Thanks again and sorry for the question, I did Google it and played around a while but with no success.
Thanks,
REMGU

Would this of been beter in the Programming Forum or XP Forum ?
XP has no MS-DOS SubSystem and you are actually using CMD.exe command line.
When you originally posted ther is a warning flagged up as follows:
"DO NOT post questions related to NT Batch (DOS command prompt) scripting on this forum. Use the Programming forum.
Use the Windows NT, 2000 or XP forum for questions regarding the Windows NT, 2000 or XP "DOS" command prompt.
DO NOT ask where to download copyrighted software, including old versions of Windows or DOS, on this forum."

Sorry. OK, I will post under Programming. Mechanix2Go, I'm giving you the credit, I hope to hear from you again!
Thanks!
Thanks,
REMGU

Hi remgu,
Just ignore 'santa'; he'd rather complain than help.
To be prompted for name of file:
::== getafile.bat
@echo offset /p filename=What file?
cd c:\ftp_temp
> my.ftp echo o 192.168.1.1
>> my.ftp echo johndoe
>> my.ftp echo password
>> my.ftp echo bin
>> my.ftp echo cd audit_dumps
>> my.ftp echo get %filename%
>> my.ftp echo byeftp -s:my.ftp
::==
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |