Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Create batch file

Original Message
Name: remgu
Date: May 2, 2007 at 10:14:56 Pacific
Subject: Create batch file
OS: XP
CPU/Ram: P4 3.4Ghz 1GB Ram
Model/Manufacturer: Clone
Comment:
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
exit

Thanks!
REMGU


Thanks,
REMGU


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: May 2, 2007 at 13:31:00 Pacific
Subject: Create batch file
Reply: (edit)
I suppose "lcd c:/ftp_temp" is a typo and what you really want is:

cd c:\ftp_temp

try this:

::==
@echo off

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 file001.prt
>> my.ftp echo bye

ftp -s:my.ftp
::==



=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 2
Name: remgu
Date: May 3, 2007 at 05:13:20 Pacific
Subject: Create batch file
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 3
Name: remgu
Date: May 3, 2007 at 05:36:11 Pacific
Subject: Create batch file
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 4
Name: Santa
Date: May 3, 2007 at 07:36:13 Pacific
Subject: Create batch file
Reply: (edit)
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."



Report Offensive Follow Up For Removal

Response Number 5
Name: remgu
Date: May 3, 2007 at 07:44:14 Pacific
Subject: Create batch file
Reply: (edit)
Sorry. OK, I will post under Programming. Mechanix2Go, I'm giving you the credit, I hope to hear from you again!

Thanks!

Thanks,
REMGU


Report Offensive Follow Up For Removal


Response Number 6
Name: Mechanix2Go
Date: May 4, 2007 at 00:34:00 Pacific
Subject: Create batch file
Reply: (edit)
Hi remgu,

Just ignore 'santa'; he'd rather complain than help.

To be prompted for name of file:

::== getafile.bat
@echo off

set /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 bye

ftp -s:my.ftp
::==



=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 7
Name: Santa
Date: May 4, 2007 at 01:39:32 Pacific
Subject: Create batch file
Reply: (edit)
Answered in the correct forum:

http://computing.net/programming/ww...


Report Offensive Follow Up For Removal

Response Number 8
Name: remgu
Date: May 4, 2007 at 06:30:26 Pacific
Subject: Create batch file
Reply: (edit)
Thanks Mechanix2Go!

Thanks,
REMGU


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Create batch file

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




Slow boot time

Trasnferring Documents from old HD

My k8T Neo-v usb's aren't working!

Date Modified = Date Created Time

system files on removable harddrive


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC